golang.org/x/tools/go/analysis: pass "gccgo" to types.SizesFor
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 22 Jan 2019 15:43:40 +0000 (15:43 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 22 Jan 2019 15:43:40 +0000 (15:43 +0000)
    For the gofrontend copy, change calls to types.SizesFor to pass
    "gccgo" rather than "gc".  Leave the asmdecl pass unchanged since that
    pass is gc-specific anyhow.

    This has been fixed in a better way in the external repo by
    https://golang.org/cl/158317 and friends, but that is not in 1.12, so
    use this approach for now.

    Reviewed-on: https://go-review.googlesource.com/c/158842

From-SVN: r268153

gcc/go/gofrontend/MERGE
libgo/go/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go
libgo/go/golang.org/x/tools/go/analysis/passes/printf/types.go
libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go
libgo/go/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go

index 90a03ee..95604f8 100644 (file)
@@ -1,4 +1,4 @@
-fb44f62e7c01ebc987dad78875f593da18100007
+e3271f3e09337b951822ba5c596d8cfe3b94508e
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index f2e8949..a6e76a1 100644 (file)
@@ -271,7 +271,7 @@ func typeCheckCgoSourceFiles(fset *token.FileSet, pkg *types.Package, files []*a
                        return importMap[path], nil
                }),
                // TODO(adonovan): Sizes should probably be provided by analysis.Pass.
-               Sizes: types.SizesFor("gc", build.Default.GOARCH),
+               Sizes: types.SizesFor("gccgo", build.Default.GOARCH),
                Error: func(error) {}, // ignore errors (e.g. unused import)
        }
 
index e881046..87523a1 100644 (file)
@@ -236,4 +236,4 @@ func matchStructArgType(pass *analysis.Pass, t printfArgType, typ *types.Struct,
        return true
 }
 
-var archSizes = types.SizesFor("gc", build.Default.GOARCH)
+var archSizes = types.SizesFor("gccgo", build.Default.GOARCH)
index 56b150b..4142ac3 100644 (file)
@@ -125,4 +125,4 @@ var (
        uintptrBitSize = 8 * archSizes.Sizeof(types.Typ[types.Uintptr])
 )
 
-var archSizes = types.SizesFor("gc", build.Default.GOARCH)
+var archSizes = types.SizesFor("gccgo", build.Default.GOARCH)
index 76dabc2..5943c99 100644 (file)
@@ -221,7 +221,7 @@ func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]re
        })
        tc := &types.Config{
                Importer: importer,
-               Sizes:    types.SizesFor("gc", build.Default.GOARCH), // assume gccgo ≡ gc?
+               Sizes:    types.SizesFor("gccgo", build.Default.GOARCH), // assume gccgo ≡ gc?
        }
        info := &types.Info{
                Types:      make(map[ast.Expr]types.TypeAndValue),