From 6a91799974e992e915facb9d9372dc8847a09a64 Mon Sep 17 00:00:00 2001 From: Logan Chien Date: Fri, 17 Feb 2012 18:43:48 +0800 Subject: Add Module as a member of IRBuilder. Change-Id: I62704b0a33b166f577fd8675bedac8f998d51294 --- src/compiler_llvm/ir_builder.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/compiler_llvm/ir_builder.cc') diff --git a/src/compiler_llvm/ir_builder.cc b/src/compiler_llvm/ir_builder.cc index 4c432718ac..582af65a41 100644 --- a/src/compiler_llvm/ir_builder.cc +++ b/src/compiler_llvm/ir_builder.cc @@ -28,7 +28,7 @@ namespace compiler_llvm { //---------------------------------------------------------------------------- IRBuilder::IRBuilder(llvm::LLVMContext& context, llvm::Module& module) -: LLVMIRBuilder(context) { +: LLVMIRBuilder(context), module_(&module) { // Get java object type from module llvm::Type* jobject_struct_type = module.getTypeByName("JavaObject"); @@ -40,7 +40,7 @@ IRBuilder::IRBuilder(llvm::LLVMContext& context, llvm::Module& module) jenv_type_ = jenv_struct_type->getPointerTo(); // Load the runtime support function declaration from module - InitRuntimeSupportFuncDecl(module); + InitRuntimeSupportFuncDecl(); } @@ -48,12 +48,12 @@ IRBuilder::IRBuilder(llvm::LLVMContext& context, llvm::Module& module) // Runtime Helper Function //---------------------------------------------------------------------------- -void IRBuilder::InitRuntimeSupportFuncDecl(llvm::Module& module) { +void IRBuilder::InitRuntimeSupportFuncDecl() { using namespace runtime_support; #define GET_RUNTIME_SUPPORT_FUNC_DECL(ID, NAME) \ do { \ - llvm::Function* fn = module.getFunction(NAME); \ + llvm::Function* fn = module_->getFunction(NAME); \ DCHECK_NE(fn, (void*)NULL) << "Function not found: " << NAME; \ runtime_support_func_decls_[ID] = fn; \ } while (0); -- cgit v1.2.3-59-g8ed1b