aboutsummaryrefslogtreecommitdiffstats
path: root/examples/BrainF
diff options
context:
space:
mode:
authorVictor Hernandez <vhernandez@apple.com>2009-11-06 01:33:24 +0000
committerVictor Hernandez <vhernandez@apple.com>2009-11-06 01:33:24 +0000
commitdf98761d08ae091420b7e9c1366de7684400fc36 (patch)
tree19dd0e96430169e3c197a4817e5e55f3d2ea277d /examples/BrainF
parent465c3bed165dc76452606ea10a34ae2ef6033e8a (diff)
downloadexternal_llvm-df98761d08ae091420b7e9c1366de7684400fc36.zip
external_llvm-df98761d08ae091420b7e9c1366de7684400fc36.tar.gz
external_llvm-df98761d08ae091420b7e9c1366de7684400fc36.tar.bz2
Revert r86077 because it caused crashes in 179.art and 175.vpr on ARM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86213 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples/BrainF')
-rw-r--r--examples/BrainF/BrainF.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/examples/BrainF/BrainF.cpp b/examples/BrainF/BrainF.cpp
index a443ad4..f17a950 100644
--- a/examples/BrainF/BrainF.cpp
+++ b/examples/BrainF/BrainF.cpp
@@ -81,11 +81,8 @@ void BrainF::header(LLVMContext& C) {
ConstantInt *val_mem = ConstantInt::get(C, APInt(32, memtotal));
BasicBlock* BB = builder->GetInsertBlock();
const Type* IntPtrTy = IntegerType::getInt32Ty(C);
- const Type* Int8Ty = IntegerType::getInt8Ty(C);
- Constant* allocsize = ConstantExpr::getSizeOf(Int8Ty);
- allocsize = ConstantExpr::getTruncOrBitCast(allocsize, IntPtrTy);
- ptr_arr = CallInst::CreateMalloc(BB, IntPtrTy, Int8Ty, allocsize, val_mem,
- NULL, "arr");
+ ptr_arr = CallInst::CreateMalloc(BB, IntPtrTy, IntegerType::getInt8Ty(C),
+ val_mem, NULL, "arr");
BB->getInstList().push_back(cast<Instruction>(ptr_arr));
//call void @llvm.memset.i32(i8 *%arr, i8 0, i32 %d, i32 1)