summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorVictor Hernandez <vhernandez@apple.com>2009-09-25 18:11:52 +0000
committerVictor Hernandez <vhernandez@apple.com>2009-09-25 18:11:52 +0000
commit3e0c99a26f365bddb667124db40a5734e35c5a2d (patch)
tree406ef499eb4ee0c0b5f704d726d1d9c39ad79694 /examples
parenta45bfd31de14321262dd5f5123d04fc953a79ff1 (diff)
Revert 82694 "Auto-upgrade malloc instructions to malloc calls." because it causes regressions in the nightly tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82784 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples')
-rw-r--r--examples/BrainF/BrainF.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/examples/BrainF/BrainF.cpp b/examples/BrainF/BrainF.cpp
index c64b87f2f39..5cf2b883bc4 100644
--- a/examples/BrainF/BrainF.cpp
+++ b/examples/BrainF/BrainF.cpp
@@ -25,7 +25,6 @@
#include "BrainF.h"
#include "llvm/Constants.h"
-#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
#include "llvm/ADT/STLExtras.h"
#include <iostream>
@@ -79,11 +78,7 @@ void BrainF::header(LLVMContext& C) {
//%arr = malloc i8, i32 %d
ConstantInt *val_mem = ConstantInt::get(C, APInt(32, memtotal));
- BasicBlock* BB = builder->GetInsertBlock();
- const Type* IntPtrTy = IntegerType::getInt32Ty(C);
- ptr_arr = CallInst::CreateMalloc(BB, IntPtrTy, IntegerType::getInt8Ty(C),
- val_mem, NULL, "arr");
- BB->getInstList().push_back(cast<Instruction>(ptr_arr));
+ ptr_arr = builder->CreateMalloc(IntegerType::getInt8Ty(C), val_mem, "arr");
//call void @llvm.memset.i32(i8 *%arr, i8 0, i32 %d, i32 1)
{