Skip to content

Commit 2198969

Browse files
committed
Wrap LLVM’s Module::getNamedValue
1 parent 723ca4b commit 2198969

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/librustc_llvm/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ extern {
924924
pub fn LLVMSetThreadLocal(GlobalVar: ValueRef, IsThreadLocal: Bool);
925925
pub fn LLVMIsGlobalConstant(GlobalVar: ValueRef) -> Bool;
926926
pub fn LLVMSetGlobalConstant(GlobalVar: ValueRef, IsConstant: Bool);
927+
pub fn LLVMGetNamedValue(M: ModuleRef, Name: *const c_char) -> ValueRef;
927928

928929
/* Operations on aliases */
929930
pub fn LLVMAddAlias(M: ModuleRef,

src/rustllvm/RustWrapper.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ extern "C" void LLVMRustPrintPassTimings() {
7777
TimerGroup::printAll(OS);
7878
}
7979

80+
extern "C" LLVMValueRef LLVMGetNamedValue(LLVMModuleRef M,
81+
const char* Name) {
82+
return wrap(unwrap(M)->getNamedValue(Name));
83+
}
84+
8085
extern "C" LLVMValueRef LLVMGetOrInsertFunction(LLVMModuleRef M,
8186
const char* Name,
8287
LLVMTypeRef FunctionTy) {

0 commit comments

Comments
 (0)