irgen: expose DisableUnusedImportCheck flag

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

llvm-svn: 225946
GitOrigin-RevId: 5ab806129318bf0cc6f9a431c988bca29af3c198
diff --git a/irgen/compiler.go b/irgen/compiler.go
index 413f31f..36d35b7 100644
--- a/irgen/compiler.go
+++ b/irgen/compiler.go
@@ -98,6 +98,10 @@
 	// 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 @@
 		TypeChecker: types.Config{
 			Import: compiler.Importer,
 			Sizes:  compiler.llvmtypes,
+			DisableUnusedImportCheck: compiler.DisableUnusedImportCheck,
 		},
 		Build:          &buildctx.Context,
 		PackageCreated: compiler.PackageCreated,