summaryrefslogtreecommitdiff
path: root/examples/BrainF
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-10-20 21:10:27 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-10-20 21:10:27 +0000
commit30815c536baacc07e925f0aef23a5395883173dc (patch)
tree2cbcf22585e99f8a87d12d5ff94f392c0d266819 /examples/BrainF
parent411bd29eea3c360d5b48a18a17b5e87f5671af0e (diff)
Diffstat (limited to 'examples/BrainF')
-rw-r--r--examples/BrainF/BrainF.cpp7
-rw-r--r--examples/BrainF/BrainFDriver.cpp2
2 files changed, 4 insertions, 5 deletions
diff --git a/examples/BrainF/BrainF.cpp b/examples/BrainF/BrainF.cpp
index 67af099d1d3a..df6687f2805e 100644
--- a/examples/BrainF/BrainF.cpp
+++ b/examples/BrainF/BrainF.cpp
@@ -80,8 +80,8 @@ 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);
- const Type* Int8Ty = IntegerType::getInt8Ty(C);
+ Type* IntPtrTy = IntegerType::getInt32Ty(C);
+ 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,
@@ -162,8 +162,7 @@ void BrainF::header(LLVMContext& C) {
};
Constant *msgptr = ConstantExpr::
- getGetElementPtr(aberrormsg, gep_params,
- array_lengthof(gep_params));
+ getGetElementPtr(aberrormsg, gep_params);
Value *puts_params[] = {
msgptr
diff --git a/examples/BrainF/BrainFDriver.cpp b/examples/BrainF/BrainFDriver.cpp
index c11a58067e8d..cdbf02a61bca 100644
--- a/examples/BrainF/BrainFDriver.cpp
+++ b/examples/BrainF/BrainFDriver.cpp
@@ -31,9 +31,9 @@
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/ExecutionEngine/GenericValue.h"
#include "llvm/ExecutionEngine/JIT.h"
-#include "llvm/Target/TargetSelect.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/raw_ostream.h"
#include <iostream>
#include <fstream>