irgen: expose DisableUnusedImportCheck flag

Differential Revision: http://reviews.llvm.org/D6956

llvm-svn: 225946
This commit is contained in:
Peter Collingbourne 2015-01-14 05:18:16 +00:00
parent c253ebc4af
commit 5ab8061293
1 changed files with 5 additions and 0 deletions

View 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,