summaryrefslogtreecommitdiff
path: root/llgo
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2015-01-14 05:17:41 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2015-01-14 05:17:41 +0000
commit1b40d3dec4bc9e57a9484ceed014f184ccdb5c1e (patch)
tree1f652cad1ca757ad23e9c3e3857642fe5e872cc1 /llgo
parentc73ee56ca070c24c031174dbc2572c40d0929710 (diff)
irgen: expose PackageCreated hook
Differential Revision: http://reviews.llvm.org/D6955
Diffstat (limited to 'llgo')
-rw-r--r--llgo/irgen/compiler.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/llgo/irgen/compiler.go b/llgo/irgen/compiler.go
index c77f4a55e96..413f31f23f1 100644
--- a/llgo/irgen/compiler.go
+++ b/llgo/irgen/compiler.go
@@ -93,6 +93,11 @@ type CompilerOptions struct {
// compiler will set this field automatically using MakeImporter().
// If Importer is non-nil, InitMap must be non-nil also.
InitMap map[*types.Package]gccgoimporter.InitData
+
+ // PackageCreated is a hook passed to the go/loader package via
+ // loader.Config, see the documentation for that package for more
+ // information.
+ PackageCreated func(*types.Package)
}
type Compiler struct {
@@ -202,7 +207,8 @@ func (compiler *compiler) compile(fset *token.FileSet, astFiles []*ast.File, imp
Import: compiler.Importer,
Sizes: compiler.llvmtypes,
},
- Build: &buildctx.Context,
+ Build: &buildctx.Context,
+ PackageCreated: compiler.PackageCreated,
}
// If no import path is specified, then set the import
// path to be the same as the package's name.