Convert ConstantExpr::getGetElementPtr and
[oota-llvm.git] / examples / BrainF / BrainF.cpp
index 67af099d1d3aecb1ff914dbc4cafceb3f3b7000e..df6687f2805e450d2b7cdae430cbdf463e133ba6 100644 (file)
@@ -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