]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove outdated TODO about inlining
authorMatthew Dempsky <mdempsky@google.com>
Tue, 10 Oct 2017 16:35:11 +0000 (09:35 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 10 Oct 2017 17:53:22 +0000 (17:53 +0000)
We've supported inlining methods called as functions for a while now.

Change-Id: I53fba426e45f91d65a38f00456c2ae1527372b50
Reviewed-on: https://go-review.googlesource.com/69530
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/inl.go
test/inline.go

index 35da0de6ddbad3ac3cb453de432527c8dd7d412f..c65eb144137aad1bf8e4afae8bf12b68aa1e7656 100644 (file)
@@ -23,7 +23,6 @@
 //
 // TODO:
 //   - inline functions with ... args
-//   - handle T.meth(f()) with func f() (t T, arg, arg, )
 
 package gc
 
index 773b047cf768542c4a0be5929805f888095dc4e5..7bb86ef8b20799c0d1553c5964093ea7e33ba3b4 100644 (file)
@@ -72,3 +72,13 @@ func switchType(x interface{}) int { // ERROR "switchType x does not escape"
                return 0
        }
 }
+
+type T struct{}
+
+func (T) meth(int, int) {} // ERROR "can inline T.meth"
+
+func k() (T, int, int) { return T{}, 0, 0 } // ERROR "can inline k"
+
+func _() { // ERROR "can inline _"
+       T.meth(k()) // ERROR "inlining call to k" "inlining call to T.meth"
+}