]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove -dolinkobj flag
authorMatthew Dempsky <mdempsky@google.com>
Tue, 16 Oct 2018 19:49:17 +0000 (12:49 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 16 Oct 2018 20:54:12 +0000 (20:54 +0000)
This used to be used by cmd/vet and some assembly generation tests, but
those were removed in CL 37691 and CL 107336. No point in keeping an
unneeded flag around.

Fixes #28220.

Change-Id: I59f8546954ab36ea61ceba81c10d6e16d74b966a
Reviewed-on: https://go-review.googlesource.com/c/142677
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/compile/internal/gc/go.go
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/gc/obj.go

index 605afd6407979002d34b693e07eaa812b52fc4a1..57533237bc8697e7a30da4cca5c727534fa3b664 100644 (file)
@@ -92,7 +92,6 @@ var pragcgobuf [][]string
 
 var outfile string
 var linkobj string
-var dolinkobj bool
 
 // nerrors is the number of compiler errors reported
 // since the last call to saveerrors.
index 9a226318b96f176272ee033919da640884bbc9ce..5b159e3661017b0868d7a60cde897b776353c437 100644 (file)
@@ -218,7 +218,6 @@ func Main(archInit func(*Arch)) {
        if sys.MSanSupported(objabi.GOOS, objabi.GOARCH) {
                flag.BoolVar(&flag_msan, "msan", false, "build code compatible with C/C++ memory sanitizer")
        }
-       flag.BoolVar(&dolinkobj, "dolinkobj", true, "generate linker-specific objects; if false, some invalid code may compile")
        flag.BoolVar(&nolocalimports, "nolocalimports", false, "reject local (relative) imports")
        flag.StringVar(&outfile, "o", "", "write output to `file`")
        flag.StringVar(&myimportpath, "p", "", "set expected package import `path`")
@@ -606,71 +605,69 @@ func Main(archInit func(*Arch)) {
        timings.Start("fe", "escapes")
        escapes(xtop)
 
-       if dolinkobj {
-               // Collect information for go:nowritebarrierrec
-               // checking. This must happen before transformclosure.
-               // We'll do the final check after write barriers are
-               // inserted.
-               if compiling_runtime {
-                       nowritebarrierrecCheck = newNowritebarrierrecChecker()
-               }
+       // Collect information for go:nowritebarrierrec
+       // checking. This must happen before transformclosure.
+       // We'll do the final check after write barriers are
+       // inserted.
+       if compiling_runtime {
+               nowritebarrierrecCheck = newNowritebarrierrecChecker()
+       }
 
-               // Phase 7: 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")
-               for _, n := range xtop {
-                       if n.Op == ODCLFUNC && n.Func.Closure != nil {
-                               Curfn = n
-                               transformclosure(n)
-                       }
+       // Phase 7: 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")
+       for _, n := range xtop {
+               if n.Op == ODCLFUNC && n.Func.Closure != nil {
+                       Curfn = n
+                       transformclosure(n)
                }
+       }
 
-               // Prepare for SSA compilation.
-               // This must be before peekitabs, because peekitabs
-               // can trigger function compilation.
-               initssaconfig()
-
-               // Just before compilation, compile itabs found on
-               // the right side of OCONVIFACE so that methods
-               // can be de-virtualized during compilation.
-               Curfn = nil
-               peekitabs()
-
-               // Phase 8: Compile top level functions.
-               // Don't use range--walk can add functions to xtop.
-               timings.Start("be", "compilefuncs")
-               fcount = 0
-               for i := 0; i < len(xtop); i++ {
-                       n := xtop[i]
-                       if n.Op == ODCLFUNC {
-                               funccompile(n)
-                               fcount++
-                       }
-               }
-               timings.AddEvent(fcount, "funcs")
+       // Prepare for SSA compilation.
+       // This must be before peekitabs, because peekitabs
+       // can trigger function compilation.
+       initssaconfig()
+
+       // Just before compilation, compile itabs found on
+       // the right side of OCONVIFACE so that methods
+       // can be de-virtualized during compilation.
+       Curfn = nil
+       peekitabs()
 
-               if nsavederrors+nerrors == 0 {
-                       fninit(xtop)
+       // Phase 8: Compile top level functions.
+       // Don't use range--walk can add functions to xtop.
+       timings.Start("be", "compilefuncs")
+       fcount = 0
+       for i := 0; i < len(xtop); i++ {
+               n := xtop[i]
+               if n.Op == ODCLFUNC {
+                       funccompile(n)
+                       fcount++
                }
+       }
+       timings.AddEvent(fcount, "funcs")
 
-               compileFunctions()
+       if nsavederrors+nerrors == 0 {
+               fninit(xtop)
+       }
 
-               if nowritebarrierrecCheck != nil {
-                       // Write barriers are now known. Check the
-                       // call graph.
-                       nowritebarrierrecCheck.check()
-                       nowritebarrierrecCheck = nil
-               }
+       compileFunctions()
 
-               // Finalize DWARF inline routine DIEs, then explicitly turn off
-               // DWARF inlining gen so as to avoid problems with generated
-               // method wrappers.
-               if Ctxt.DwFixups != nil {
-                       Ctxt.DwFixups.Finalize(myimportpath, Debug_gendwarfinl != 0)
-                       Ctxt.DwFixups = nil
-                       genDwarfInline = 0
-               }
+       if nowritebarrierrecCheck != nil {
+               // Write barriers are now known. Check the
+               // call graph.
+               nowritebarrierrecCheck.check()
+               nowritebarrierrecCheck = nil
+       }
+
+       // Finalize DWARF inline routine DIEs, then explicitly turn off
+       // DWARF inlining gen so as to avoid problems with generated
+       // method wrappers.
+       if Ctxt.DwFixups != nil {
+               Ctxt.DwFixups.Finalize(myimportpath, Debug_gendwarfinl != 0)
+               Ctxt.DwFixups = nil
+               genDwarfInline = 0
        }
 
        // Phase 9: Check external declarations.
index 19862c03aa0502384241305dc0241648b1d8471f..aed0f060cf949372d9d2fe4358e71bd84c5570a2 100644 (file)
@@ -43,10 +43,6 @@ const (
 )
 
 func dumpobj() {
-       if !dolinkobj {
-               dumpobj1(outfile, modeCompilerObj)
-               return
-       }
        if linkobj == "" {
                dumpobj1(outfile, modeCompilerObj|modeLinkerObj)
                return