forked from OSchip/llvm-project
irgen: return a types.Package to the compiler client
Differential Revision: http://reviews.llvm.org/D6802 llvm-svn: 225028
This commit is contained in:
parent
82a260eaaf
commit
76c1d4e4dd
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue