X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=examples%2FBrainF%2FBrainF.cpp;h=f8129b819e3a6da2a3081a0a140a44a8232816f6;hb=0a230e0d985625a3909cb78fd867a3abaf434565;hp=67af099d1d3aecb1ff914dbc4cafceb3f3b7000e;hpb=0bd9d3af54b62152355525bea7914bdef4600371;p=oota-llvm.git diff --git a/examples/BrainF/BrainF.cpp b/examples/BrainF/BrainF.cpp index 67af099d1d3..f8129b819e3 100644 --- a/examples/BrainF/BrainF.cpp +++ b/examples/BrainF/BrainF.cpp @@ -24,10 +24,10 @@ //===--------------------------------------------------------------------===// #include "BrainF.h" -#include "llvm/Constants.h" -#include "llvm/Instructions.h" -#include "llvm/Intrinsics.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/IR/Constants.h" +#include "llvm/IR/Instructions.h" +#include "llvm/IR/Intrinsics.h" #include using namespace llvm; @@ -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, @@ -134,7 +134,8 @@ void BrainF::header(LLVMContext& C) { { //@aberrormsg = internal constant [%d x i8] c"\00" Constant *msg_0 = - ConstantArray::get(C, "Error: The head has left the tape.", true); + ConstantDataArray::getString(C, "Error: The head has left the tape.", + true); GlobalVariable *aberrormsg = new GlobalVariable( *module, @@ -162,8 +163,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