irgen: expose DisableUnusedImportCheck flag
authorPeter Collingbourne <peter@pcc.me.uk>
Wed, 14 Jan 2015 05:18:16 +0000 (05:18 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Wed, 14 Jan 2015 05:18:16 +0000 (05:18 +0000)
Differential Revision: http://reviews.llvm.org/D6956

llvm-svn: 225946

llgo/irgen/compiler.go

index 413f31f..36d35b7 100644 (file)
@@ -98,6 +98,10 @@ type CompilerOptions struct {
        // loader.Config, see the documentation for that package for more
        // information.
        PackageCreated func(*types.Package)
+
+       // DisableUnusedImportCheck disables the unused import check performed
+       // by go/types if set to true.
+       DisableUnusedImportCheck bool
 }
 
 type Compiler struct {
@@ -206,6 +210,7 @@ func (compiler *compiler) compile(fset *token.FileSet, astFiles []*ast.File, imp
                TypeChecker: types.Config{
                        Import: compiler.Importer,
                        Sizes:  compiler.llvmtypes,
+                       DisableUnusedImportCheck: compiler.DisableUnusedImportCheck,
                },
                Build:          &buildctx.Context,
                PackageCreated: compiler.PackageCreated,