From: Ian Lance Taylor Date: Tue, 22 Jan 2019 15:43:40 +0000 (+0000) Subject: golang.org/x/tools/go/analysis: pass "gccgo" to types.SizesFor X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=494df8753b8c0a4dd02e7208e0bae20bee6ec1d5;p=gcc.git golang.org/x/tools/go/analysis: pass "gccgo" to types.SizesFor 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 --- diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 90a03eeaa5a..95604f851dd 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -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. diff --git a/libgo/go/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go b/libgo/go/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go index f2e8949f607..a6e76a192de 100644 --- a/libgo/go/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go +++ b/libgo/go/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go @@ -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) } diff --git a/libgo/go/golang.org/x/tools/go/analysis/passes/printf/types.go b/libgo/go/golang.org/x/tools/go/analysis/passes/printf/types.go index e8810464cd4..87523a19c67 100644 --- a/libgo/go/golang.org/x/tools/go/analysis/passes/printf/types.go +++ b/libgo/go/golang.org/x/tools/go/analysis/passes/printf/types.go @@ -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) diff --git a/libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go b/libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go index 56b150b2b13..4142ac342ad 100644 --- a/libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go +++ b/libgo/go/golang.org/x/tools/go/analysis/passes/shift/shift.go @@ -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) diff --git a/libgo/go/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go b/libgo/go/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go index 76dabc28b90..5943c99e13b 100644 --- a/libgo/go/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go +++ b/libgo/go/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go @@ -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),