Skip to content

Commit

Permalink
Wrap LLVM’s Module::getNamedValue
Browse files Browse the repository at this point in the history
  • Loading branch information
nagisa committed Apr 3, 2015
1 parent 723ca4b commit 2198969
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/librustc_llvm/lib.rs
Expand Up @@ -924,6 +924,7 @@ extern {
pub fn LLVMSetThreadLocal(GlobalVar: ValueRef, IsThreadLocal: Bool);
pub fn LLVMIsGlobalConstant(GlobalVar: ValueRef) -> Bool;
pub fn LLVMSetGlobalConstant(GlobalVar: ValueRef, IsConstant: Bool);
pub fn LLVMGetNamedValue(M: ModuleRef, Name: *const c_char) -> ValueRef;

/* Operations on aliases */
pub fn LLVMAddAlias(M: ModuleRef,
Expand Down
5 changes: 5 additions & 0 deletions src/rustllvm/RustWrapper.cpp
Expand Up @@ -77,6 +77,11 @@ extern "C" void LLVMRustPrintPassTimings() {
TimerGroup::printAll(OS);
}

extern "C" LLVMValueRef LLVMGetNamedValue(LLVMModuleRef M,
const char* Name) {
return wrap(unwrap(M)->getNamedValue(Name));
}

extern "C" LLVMValueRef LLVMGetOrInsertFunction(LLVMModuleRef M,
const char* Name,
LLVMTypeRef FunctionTy) {
Expand Down

0 comments on commit 2198969

Please sign in to comment.