irgen: return a types.Package to the compiler client

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

llvm-svn: 225028
This commit is contained in:
Peter Collingbourne 2014-12-31 00:25:35 +00:00
parent 82a260eaaf
commit 76c1d4e4dd
1 changed files with 2 additions and 1 deletions

View File

@ -38,6 +38,7 @@ type Module struct {
llvm.Module llvm.Module
Path string Path string
ExportData []byte ExportData []byte
Package *types.Package
disposed bool disposed bool
} }
@ -194,7 +195,7 @@ func (compiler *compiler) compile(fset *token.FileSet, astFiles []*ast.File, imp
// Create a Module, which contains the LLVM module. // Create a Module, which contains the LLVM module.
modulename := importpath 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.SetTarget(compiler.TargetTriple)
compiler.module.SetDataLayout(compiler.dataLayout) compiler.module.SetDataLayout(compiler.dataLayout)