diff options
Diffstat (limited to 'src/cmd/compile/internal/gc/main.go')
-rw-r--r-- | src/cmd/compile/internal/gc/main.go | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index c1cc7ed377..feded3f9b2 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -58,7 +58,7 @@ var Target *ir.Package // arguments, type-checks the parsed Go package, compiles functions to machine // code, and finally writes the compiled package definition to disk. func Main(archInit func(*Arch)) { - timings.Start("fe", "init") + base.Timer.Start("fe", "init") defer hidePanic() @@ -123,7 +123,7 @@ func Main(archInit func(*Arch)) { // changes in the binary.) recordFlags("B", "N", "l", "msan", "race", "shared", "dynlink", "dwarflocationlists", "dwarfbasentries", "smallframes", "spectre") - if !enableTrace && base.Flag.LowerT { + if !base.EnableTrace && base.Flag.LowerT { log.Fatalf("compiler not built with support for -t") } @@ -159,7 +159,7 @@ func Main(archInit func(*Arch)) { readSymABIs(base.Flag.SymABIs, base.Ctxt.Pkgpath) } - if ispkgin(omit_pkgs) { + if base.Compiling(base.NoInstrumentPkgs) { base.Flag.Race = false base.Flag.MSan = false } @@ -173,7 +173,7 @@ func Main(archInit func(*Arch)) { msanpkg = types.NewPkg("runtime/msan", "") } if base.Flag.Race || base.Flag.MSan { - instrumenting = true + base.Flag.Cfg.Instrumenting = true } if base.Flag.Dwarf { dwarf.EnableLogging(base.Debug.DwarfInl != 0) @@ -205,7 +205,7 @@ func Main(archInit func(*Arch)) { NeedITab = func(t, iface *types.Type) { itabname(t, iface) } NeedRuntimeType = addsignat // TODO(rsc): typenamesym for lock? - autogeneratedPos = makePos(src.NewFileBase("<autogenerated>", "<autogenerated>"), 1, 0) + base.AutogeneratedPos = makePos(src.NewFileBase("<autogenerated>", "<autogenerated>"), 1, 0) types.TypeLinkSym = func(t *types.Type) *obj.LSym { return typenamesym(t).Linksym() @@ -213,11 +213,11 @@ func Main(archInit func(*Arch)) { TypecheckInit() // Parse input. - timings.Start("fe", "parse") + base.Timer.Start("fe", "parse") lines := parseFiles(flag.Args()) cgoSymABIs() - timings.Stop() - timings.AddEvent(int64(lines), "lines") + base.Timer.Stop() + base.Timer.AddEvent(int64(lines), "lines") recordPackageName() // Typecheck. @@ -233,7 +233,7 @@ func Main(archInit func(*Arch)) { } // Inlining - timings.Start("fe", "inlining") + base.Timer.Start("fe", "inlining") if base.Flag.LowerL != 0 { InlinePackage() } @@ -254,7 +254,7 @@ func Main(archInit func(*Arch)) { // or else the stack copier will not update it. // Large values are also moved off stack in escape analysis; // because large values may contain pointers, it must happen early. - timings.Start("fe", "escapes") + base.Timer.Start("fe", "escapes") escapes(Target.Decls) // Collect information for go:nowritebarrierrec @@ -268,7 +268,7 @@ func Main(archInit func(*Arch)) { // Transform closure bodies to properly reference captured variables. // This needs to happen before walk, because closures must be transformed // before walk reaches a call of a closure. - timings.Start("fe", "xclosures") + base.Timer.Start("fe", "xclosures") for _, n := range Target.Decls { if n.Op() == ir.ODCLFUNC { n := n.(*ir.Func) @@ -292,7 +292,7 @@ func Main(archInit func(*Arch)) { // Compile top level functions. // Don't use range--walk can add functions to Target.Decls. - timings.Start("be", "compilefuncs") + base.Timer.Start("be", "compilefuncs") fcount := int64(0) for i := 0; i < len(Target.Decls); i++ { n := Target.Decls[i] @@ -301,7 +301,7 @@ func Main(archInit func(*Arch)) { fcount++ } } - timings.AddEvent(fcount, "funcs") + base.Timer.AddEvent(fcount, "funcs") compileFunctions() @@ -320,7 +320,7 @@ func Main(archInit func(*Arch)) { } // Write object data to disk. - timings.Start("be", "dumpobj") + base.Timer.Start("be", "dumpobj") dumpdata() base.Ctxt.NumberSyms() dumpobj() @@ -339,7 +339,7 @@ func Main(archInit func(*Arch)) { base.ExitIfErrors() base.FlushErrors() - timings.Stop() + base.Timer.Stop() if base.Flag.Bench != "" { if err := writebench(base.Flag.Bench); err != nil { @@ -397,7 +397,7 @@ func writebench(filename string) error { fmt.Fprintln(&buf, "commit:", objabi.Version) fmt.Fprintln(&buf, "goos:", runtime.GOOS) fmt.Fprintln(&buf, "goarch:", runtime.GOARCH) - timings.Write(&buf, "BenchmarkCompile:"+base.Ctxt.Pkgpath+":") + base.Timer.Write(&buf, "BenchmarkCompile:"+base.Ctxt.Pkgpath+":") n, err := f.Write(buf.Bytes()) if err != nil { |