irgen: return a types.Package to the compiler client
Differential Revision: http://reviews.llvm.org/D6802
llvm-svn: 225028
GitOrigin-RevId: 76c1d4e4ddbb541d63de5559baaee34fadd37500
diff --git a/irgen/compiler.go b/irgen/compiler.go
index de496ff..c7768e2 100644
--- a/irgen/compiler.go
+++ b/irgen/compiler.go
@@ -38,6 +38,7 @@
llvm.Module
Path string
ExportData []byte
+ Package *types.Package
disposed bool
}
@@ -194,7 +195,7 @@
// Create a Module, which contains the LLVM module.
modulename := importpath
- compiler.module = &Module{Module: llvm.NewModule(modulename), Path: modulename}
+ compiler.module = &Module{Module: llvm.NewModule(modulename), Path: modulename, Package: mainPkg.Object}
compiler.module.SetTarget(compiler.TargetTriple)
compiler.module.SetDataLayout(compiler.dataLayout)