diff --git a/cmd/gotype/doc.go b/cmd/gotype/doc.go index cafa2322..e6893781 100644 --- a/cmd/gotype/doc.go +++ b/cmd/gotype/doc.go @@ -27,6 +27,8 @@ The flags are: report all errors (not just the first 10) -v verbose mode + -gccgo + use gccimporter instead of gcimporter Debugging flags: -seq diff --git a/cmd/gotype/gotype.go b/cmd/gotype/gotype.go index 45808087..efc5a4c1 100644 --- a/cmd/gotype/gotype.go +++ b/cmd/gotype/gotype.go @@ -18,6 +18,7 @@ import ( "runtime" "time" + "code.google.com/p/go.tools/go/gccgoimporter" _ "code.google.com/p/go.tools/go/gcimporter" "code.google.com/p/go.tools/go/types" ) @@ -27,6 +28,7 @@ var ( allFiles = flag.Bool("a", false, "use all (incl. _test.go) files when processing a directory") allErrors = flag.Bool("e", false, "report all errors (not just the first 10)") verbose = flag.Bool("v", false, "verbose mode") + gccgo = flag.Bool("gccgo", false, "use gccgoimporter instead of gcimporter") // debugging support sequential = flag.Bool("seq", false, "parse sequentially, rather than in parallel") @@ -195,6 +197,11 @@ func checkPkgFiles(files []*ast.File) { }, Sizes: sizes, } + if *gccgo { + var inst gccgoimporter.GccgoInstallation + inst.InitFromDriver("gccgo") + conf.Import = inst.GetImporter(nil) + } defer func() { switch p := recover().(type) {