Whoever Marvin is, we're one step closer to realizing his dream.
Change-Id: I8dece4417d0f9ec234be158d0ee7bc6735342d93
Reviewed-on: https://go-review.googlesource.com/27465
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
case ODEFER, OPROC:
switch n.Left.Op {
case OCALLFUNC, OCALLMETH:
- // TODO(marvin): Fix Node.EType type union.
- n.Left.Etype = EType(n.Op)
+ n.Left.setNoInline(true)
}
fallthrough
// switch at the top of this function.
switch n.Op {
case OCALLFUNC, OCALLMETH:
- // TODO(marvin): Fix Node.EType type union.
- if n.Etype == EType(OPROC) || n.Etype == EType(ODEFER) {
+ if n.noInline() {
return n
}
}
notLiveAtEnd
isClosureVar
isOutputParamHeapAddr
+ noInline // used internally by inliner to indicate that a function call should not be inlined; set for OCALLFUNC and OCALLMETH only
)
func (n *Node) HasBreak() bool {
n.flags &^= isClosureVar
}
}
+func (n *Node) noInline() bool {
+ return n.flags&noInline != 0
+}
+func (n *Node) setNoInline(b bool) {
+ if b {
+ n.flags |= noInline
+ } else {
+ n.flags &^= noInline
+ }
+}
func (n *Node) IsOutputParamHeapAddr() bool {
return n.flags&isOutputParamHeapAddr != 0