aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/Core.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-10-17 23:52:26 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-10-17 23:52:26 +0000
commit3fc35c594cbe48070ad69eaa2fdca1e9424c9fd4 (patch)
treef2e8f76264ef8e7298de66b69bc2c3a1381a8ba9 /lib/VMCore/Core.cpp
parent391d23b6c29e17b5c969e732169a789ac9d0d422 (diff)
Fix test/Bindings/Ocaml/vmcore.ml. When IRBuilder::CreateMalloc was removed,
LLVMBuildMalloc was reimplemented but with the bug that it didn't insert the resulting instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84374 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Core.cpp')
-rw-r--r--lib/VMCore/Core.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp
index 5b8295f60d..d1bf063446 100644
--- a/lib/VMCore/Core.cpp
+++ b/lib/VMCore/Core.cpp
@@ -1700,15 +1700,17 @@ LLVMValueRef LLVMBuildNot(LLVMBuilderRef B, LLVMValueRef V, const char *Name) {
LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef B, LLVMTypeRef Ty,
const char *Name) {
const Type* IntPtrT = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext());
- return wrap(CallInst::CreateMalloc(unwrap(B)->GetInsertBlock(), IntPtrT,
- unwrap(Ty), 0, 0, Twine(Name)));
+ return wrap(unwrap(B)->Insert(CallInst::CreateMalloc(
+ unwrap(B)->GetInsertBlock(), IntPtrT, unwrap(Ty), 0, 0, ""),
+ Twine(Name)));
}
LLVMValueRef LLVMBuildArrayMalloc(LLVMBuilderRef B, LLVMTypeRef Ty,
LLVMValueRef Val, const char *Name) {
const Type* IntPtrT = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext());
- return wrap(CallInst::CreateMalloc(unwrap(B)->GetInsertBlock(), IntPtrT,
- unwrap(Ty), unwrap(Val), 0, Twine(Name)));
+ return wrap(unwrap(B)->Insert(CallInst::CreateMalloc(
+ unwrap(B)->GetInsertBlock(), IntPtrT, unwrap(Ty), unwrap(Val), 0, ""),
+ Twine(Name)));
}
LLVMValueRef LLVMBuildAlloca(LLVMBuilderRef B, LLVMTypeRef Ty,