summaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/gc/walk.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2020-12-23 00:05:23 -0500
committerRuss Cox <rsc@golang.org>2020-12-23 06:37:55 +0000
commitead4957892bc1975d9cc9c32777733c67e5a885e (patch)
tree832d82f1ea11b03243900acb62af2cbe88922762 /src/cmd/compile/internal/gc/walk.go
parent440308ffd7061e0eb386a9a8469575528b41dcd4 (diff)
downloadgo-git-ead4957892bc1975d9cc9c32777733c67e5a885e.tar.gz
[dev.regabi] cmd/compile: move helpers into package base [generated]
[git-generate] cd src/cmd/compile/internal/gc rf ' # Move EnableTrace constant into base, with the other flags. mv enableTrace EnableTrace mv EnableTrace base.go # Move compilation checks to base. mv instrumenting Instrumenting mv ispkgin Compiling mv omit_pkgs NoInstrumentPkgs mv norace_inst_pkgs NoRacePkgs mv Instrumenting Compiling NoInstrumentPkgs NoRacePkgs base.go # Move AutogeneratedPos to package base, next to Pos. mv autogeneratedPos AutogeneratedPos mv AutogeneratedPos print.go mv timings Timer mv base.go print.go timings.go cmd/compile/internal/base ' cd ../base rf ' mv Instrumenting Flag.Cfg.Instrumenting ' Change-Id: I534437fa75857d31531fc499d833c9930c0a06d0 Reviewed-on: https://go-review.googlesource.com/c/go/+/279420 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/gc/walk.go')
-rw-r--r--src/cmd/compile/internal/gc/walk.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/cmd/compile/internal/gc/walk.go b/src/cmd/compile/internal/gc/walk.go
index 610c6b6539..57edc43280 100644
--- a/src/cmd/compile/internal/gc/walk.go
+++ b/src/cmd/compile/internal/gc/walk.go
@@ -85,7 +85,7 @@ func walk(fn *ir.Func) {
ir.DumpList(s, Curfn.Enter)
}
- if instrumenting {
+ if base.Flag.Cfg.Instrumenting {
instrument(fn)
}
}
@@ -738,7 +738,7 @@ func walkexpr1(n ir.Node, init *ir.Nodes) ir.Node {
return as
}
- if !instrumenting && isZero(as.Y) {
+ if !base.Flag.Cfg.Instrumenting && isZero(as.Y) {
return as
}
@@ -1311,7 +1311,7 @@ func walkexpr1(n ir.Node, init *ir.Nodes) ir.Node {
panic("unreachable")
case ir.OCOPY:
- return copyany(n.(*ir.BinaryExpr), init, instrumenting && !base.Flag.CompilingRuntime)
+ return copyany(n.(*ir.BinaryExpr), init, base.Flag.Cfg.Instrumenting && !base.Flag.CompilingRuntime)
case ir.OCLOSE:
// cannot use chanfn - closechan takes any, not chan any
@@ -1597,7 +1597,7 @@ func walkexpr1(n ir.Node, init *ir.Nodes) ir.Node {
case ir.OBYTES2STRTMP:
n := n.(*ir.ConvExpr)
n.X = walkexpr(n.X, init)
- if !instrumenting {
+ if !base.Flag.Cfg.Instrumenting {
// Let the backend handle OBYTES2STRTMP directly
// to avoid a function call to slicebytetostringtmp.
return n
@@ -1975,7 +1975,7 @@ func walkCall(n *ir.CallExpr, init *ir.Nodes) {
} else {
t = params.Field(i).Type
}
- if instrumenting || fncall(arg, t) {
+ if base.Flag.Cfg.Instrumenting || fncall(arg, t) {
// make assignment of fncall to tempAt
tmp := temp(t)
a := convas(ir.NewAssignStmt(base.Pos, tmp, arg), init)
@@ -2873,7 +2873,7 @@ func appendslice(n *ir.CallExpr, init *ir.Nodes) ir.Node {
ptr1, len1 := backingArrayPtrLen(cheapexpr(slice, &nodes))
ptr2, len2 := backingArrayPtrLen(l2)
ncopy = mkcall1(fn, types.Types[types.TINT], &nodes, typename(elemtype), ptr1, len1, ptr2, len2)
- } else if instrumenting && !base.Flag.CompilingRuntime {
+ } else if base.Flag.Cfg.Instrumenting && !base.Flag.CompilingRuntime {
// rely on runtime to instrument:
// copy(s[len(l1):], l2)
// l2 can be a slice or string.
@@ -2914,7 +2914,7 @@ func appendslice(n *ir.CallExpr, init *ir.Nodes) ir.Node {
// isAppendOfMake reports whether n is of the form append(x , make([]T, y)...).
// isAppendOfMake assumes n has already been typechecked.
func isAppendOfMake(n ir.Node) bool {
- if base.Flag.N != 0 || instrumenting {
+ if base.Flag.N != 0 || base.Flag.Cfg.Instrumenting {
return false
}
@@ -3125,7 +3125,7 @@ func walkappend(n *ir.CallExpr, init *ir.Nodes, dst ir.Node) ir.Node {
// General case, with no function calls left as arguments.
// Leave for gen, except that instrumentation requires old form.
- if !instrumenting || base.Flag.CompilingRuntime {
+ if !base.Flag.Cfg.Instrumenting || base.Flag.CompilingRuntime {
return n
}
@@ -4055,7 +4055,7 @@ func canMergeLoads() bool {
// isRuneCount reports whether n is of the form len([]rune(string)).
// These are optimized into a call to runtime.countrunes.
func isRuneCount(n ir.Node) bool {
- return base.Flag.N == 0 && !instrumenting && n.Op() == ir.OLEN && n.(*ir.UnaryExpr).X.Op() == ir.OSTR2RUNES
+ return base.Flag.N == 0 && !base.Flag.Cfg.Instrumenting && n.Op() == ir.OLEN && n.(*ir.UnaryExpr).X.Op() == ir.OSTR2RUNES
}
func walkCheckPtrAlignment(n *ir.ConvExpr, init *ir.Nodes, count ir.Node) ir.Node {