rustllvm: Add a GetOrInsertFunction wrapper

Fixes issue #1161

Test-case-by: Brian Anderson <banderson@mozilla.com>
Signed-off-by: Haitao Li <lihaitao@gmail.com>
This commit is contained in:
Haitao Li 2011-11-15 00:32:31 +08:00
parent 453168d917
commit b8dd148444
5 changed files with 23 additions and 1 deletions

View file

@ -141,3 +141,9 @@ extern "C" void LLVMRustEnableSegmentedStacks() {
EnableSegmentedStacks = true;
}
extern "C" LLVMValueRef LLVMGetOrInsertFunction(LLVMModuleRef M,
const char* Name,
LLVMTypeRef FunctionTy) {
return wrap(unwrap(M)->getOrInsertFunction(Name,
unwrap<FunctionType>(FunctionTy)));
}

View file

@ -364,6 +364,7 @@ LLVMGetNextParam
LLVMGetNextUse
LLVMGetNumOperands
LLVMGetOperand
LLVMGetOrInsertFunction
LLVMGetParam
LLVMGetParamParent
LLVMGetParamTypes