From c253ebc4af2042e2655987635349eb8047fe54c8 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 14 Jan 2015 05:17:41 +0000 Subject: [PATCH] irgen: expose PackageCreated hook Differential Revision: http://reviews.llvm.org/D6955 llvm-svn: 225945 --- llgo/irgen/compiler.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/llgo/irgen/compiler.go b/llgo/irgen/compiler.go index c77f4a5..413f31f 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. -- 2.7.4