[vmkit-commits] [vmkit] r135703 - in /vmkit/trunk: include/mvm/JIT.h lib/J3/Compiler/JavaAOTCompiler.cpp lib/J3/Compiler/JavaJIT.cpp lib/J3/Compiler/JavaJIT.h lib/J3/Compiler/JavaJITCompiler.cpp lib/J3/Compiler/JavaJITOpcodes.cpp lib/J3/Compiler/LLVMInfo.cpp lib/J3/Compiler/LLVMMaterializer.cpp lib/J3/Compiler/LowerConstantCalls.cpp lib/Mvm/Compiler/JIT.cpp mmtk/magic/LowerMagic.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Thu Jul 21 13:58:12 PDT 2011
Author: geoffray
Date: Thu Jul 21 15:58:12 2011
New Revision: 135703
URL: http://llvm.org/viewvc/llvm-project?rev=135703&view=rev
Log:
Update to new LLVM API.
Modified:
vmkit/trunk/include/mvm/JIT.h
vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp
vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp
vmkit/trunk/lib/J3/Compiler/JavaJIT.h
vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp
vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp
vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp
vmkit/trunk/lib/J3/Compiler/LLVMMaterializer.cpp
vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp
vmkit/trunk/lib/Mvm/Compiler/JIT.cpp
vmkit/trunk/mmtk/magic/LowerMagic.cpp
Modified: vmkit/trunk/include/mvm/JIT.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/JIT.h?rev=135703&r1=135702&r2=135703&view=diff
==============================================================================
--- vmkit/trunk/include/mvm/JIT.h (original)
+++ vmkit/trunk/include/mvm/JIT.h Thu Jul 21 15:58:12 2011
@@ -189,7 +189,7 @@
static llvm::ExecutionEngine* executionEngine;
//static unsigned MetadataTypeKind;
- static uint64 getTypeSize(const llvm::Type* type);
+ static uint64 getTypeSize(llvm::Type* type);
static void runPasses(llvm::Function* func, llvm::FunctionPassManager*);
static void initialise(llvm::CodeGenOpt::Level = llvm::CodeGenOpt::Default,
llvm::Module* TheModule = 0,
Modified: vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp?rev=135703&r1=135702&r2=135703&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaAOTCompiler.cpp Thu Jul 21 15:58:12 2011
@@ -1841,7 +1841,7 @@
for (string_iterator i = strings.begin(), e = strings.end(); i != e; ++i) {
Args[0] = loader;
Args[1] = i->second;
- CallInst::Create(AddString, Args, Args + 2, "", currentBlock);
+ CallInst::Create(AddString, ArrayRef<Value*>(Args, 2), "", currentBlock);
}
}
@@ -1851,7 +1851,7 @@
Args[0] = loader;
Args[1] = ConstantExpr::getBitCast(i->second,
JavaIntrinsics.JavaCommonClassType);
- CallInst::Create(AddClass, Args, Args + 2, "", currentBlock);
+ CallInst::Create(AddClass, ArrayRef<Value*>(Args, 2), "", currentBlock);
}
}
@@ -1860,7 +1860,7 @@
Args[0] = loader;
Args[1] = i->second;
Args[2] = getUTF8(i->first->name);
- CallInst::Create(GetClassArray, Args, Args + 3, "", currentBlock);
+ CallInst::Create(GetClassArray, ArrayRef<Value*>(Args, 3), "", currentBlock);
}
@@ -2272,7 +2272,7 @@
jit ? "StartJnjvmWithJIT" : "StartJnjvmWithoutJIT",
TheModule);
- Value* res = CallInst::Create(CalledFunc, Args, Args + 3, "", currentBlock);
+ Value* res = CallInst::Create(CalledFunc, ArrayRef<Value*>(Args, 3), "", currentBlock);
ReturnInst::Create(getLLVMContext(), res, currentBlock);
}
Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp?rev=135703&r1=135702&r2=135703&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaJIT.cpp Thu Jul 21 15:58:12 2011
@@ -114,9 +114,9 @@
Typedef* retTypedef = signature->getReturnType();
std::vector<Value*> args; // size = [signature->nbIn + 3];
LLVMSignatureInfo* LSI = TheCompiler->getSignatureInfo(signature);
- const llvm::FunctionType* virtualType = LSI->getVirtualType();
+ llvm::FunctionType* virtualType = LSI->getVirtualType();
FunctionType::param_iterator it = virtualType->param_end();
- const llvm::Type* retType = virtualType->getReturnType();
+ llvm::Type* retType = virtualType->getReturnType();
bool needsInit = false;
if (canBeDirect && meth && !TheCompiler->needsCallback(meth, &needsInit)) {
@@ -173,8 +173,7 @@
Value* VT = CallInst::Create(intrinsics->GetVTFunction, args[0], "",
currentBlock);
- Value* FuncPtr = GetElementPtrInst::Create(VT, indexes2, indexes2 + 2, "",
- currentBlock);
+ Value* FuncPtr = GetElementPtrInst::Create(VT, indexes2, indexes2 + 2, "", currentBlock);
Value* Func = new LoadInst(FuncPtr, "", currentBlock);
@@ -277,8 +276,8 @@
bool stat = isStatic(compilingMethod->access);
- const FunctionType *funcType = llvmFunction->getFunctionType();
- const llvm::Type* returnType = funcType->getReturnType();
+ FunctionType *funcType = llvmFunction->getFunctionType();
+ Type* returnType = funcType->getReturnType();
bool j3 = false;
@@ -329,8 +328,7 @@
i++) {
args.push_back(i);
}
- Value* res = CallInst::Create(
- callee, args.begin(), args.end(), "", currentBlock);
+ Value* res = CallInst::Create(callee, args, "", currentBlock);
if (returnType != Type::getVoidTy(*llvmContext)) {
ReturnInst::Create(*llvmContext, res, currentBlock);
} else {
@@ -384,7 +382,7 @@
if (i->getType() == intrinsics->JavaObjectType) {
BasicBlock* BB = createBasicBlock("");
BasicBlock* NotZero = createBasicBlock("");
- const Type* Ty = PointerType::getUnqual(intrinsics->JavaObjectType);
+ Type* Ty = PointerType::getUnqual(intrinsics->JavaObjectType);
PHINode* node = PHINode::Create(Ty, 2, "", BB);
Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, i,
@@ -408,7 +406,7 @@
intrinsics->constantPtrNull
};
- CallInst::Create(intrinsics->llvm_gc_gcroot, GCArgs, GCArgs + 2, "",
+ CallInst::Create(intrinsics->llvm_gc_gcroot, GCArgs, "",
func->begin()->getTerminator());
}
@@ -437,7 +435,7 @@
intrinsics->constantPtrNull
};
- CallInst::Create(intrinsics->llvm_gc_gcroot, GCArgs, GCArgs + 2, "",
+ CallInst::Create(intrinsics->llvm_gc_gcroot, GCArgs, "",
currentBlock);
} else {
new StoreInst(intrinsics->JavaObjectNullConstant, ResultObject, "",
@@ -455,7 +453,7 @@
BasicBlock* unloadedBlock = createBasicBlock("");
BasicBlock* endBlock = createBasicBlock("");
Value* test = new LoadInst(nativeFunc, "", currentBlock);
- const llvm::Type* Ty = test->getType();
+ Type* Ty = test->getType();
PHINode* node = PHINode::Create(Ty, 2, "", endBlock);
node->addIncoming(test, currentBlock);
Value* cmp = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, test,
@@ -480,14 +478,13 @@
Value* Args4[3] = { temp, oldCLIN, Frame };
- CallInst::Create(intrinsics->StartJNIFunction, Args4, Args4 + 3, "",
- currentBlock);
+ CallInst::Create(intrinsics->StartJNIFunction, Args4, "", currentBlock);
- Value* result = llvm::CallInst::Create(nativeFunc, nativeArgs.begin(),
- nativeArgs.end(), "", currentBlock);
+ Value* result = llvm::CallInst::Create(nativeFunc, nativeArgs, "",
+ currentBlock);
if (returnType == intrinsics->JavaObjectType) {
- const Type* Ty = PointerType::getUnqual(intrinsics->JavaObjectType);
+ Type* Ty = PointerType::getUnqual(intrinsics->JavaObjectType);
Constant* C = Constant::getNullValue(Ty);
Value* cmp = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, result, C, "");
BasicBlock* loadBlock = createBasicBlock("");
@@ -512,7 +509,7 @@
Value* Args2[1] = { oldCLIN };
- CallInst::Create(intrinsics->EndJNIFunction, Args2, Args2 + 1, "", currentBlock);
+ CallInst::Create(intrinsics->EndJNIFunction, Args2, "", currentBlock);
// Synchronize after leaving native.
if (isSynchro(compilingMethod->access))
@@ -560,8 +557,7 @@
// Do the atomic compare and swap.
Value* atomic = CallInst::Create(intrinsics->llvm_atomic_lcs_ptr,
- atomicArgs.begin(), atomicArgs.end(), "",
- currentBlock);
+ atomicArgs, "", currentBlock);
Value* cmp = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, atomic,
lock, "");
@@ -609,8 +605,7 @@
// Do the atomic compare and swap.
Value* atomic = CallInst::Create(intrinsics->llvm_atomic_lcs_ptr,
- atomicArgs.begin(), atomicArgs.end(), "",
- currentBlock);
+ atomicArgs, "", currentBlock);
Value* cmp = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, atomic,
oldValMask, "");
@@ -685,8 +680,7 @@
Instruction* I = new BitCastInst(temp, intrinsics->ptrPtrType, "");
I->insertAfter(temp);
Value* GCArgs[2] = { I, intrinsics->constantPtrNull };
- Instruction* C = CallInst::Create(intrinsics->llvm_gc_gcroot, GCArgs,
- GCArgs + 2, "");
+ Instruction* C = CallInst::Create(intrinsics->llvm_gc_gcroot, GCArgs, "");
C->insertAfter(I);
}
}
@@ -724,7 +718,7 @@
assert(LMI);
Function* func = LMI->getMethod();
- const Type* returnType = func->getReturnType();
+ Type* returnType = func->getReturnType();
endBlock = createBasicBlock("end");
currentBlock = curBB;
@@ -818,7 +812,7 @@
for (;count < max; ++i, ++index, ++count, ++type) {
const Typedef* cur = arguments[type];
- const Type* curType = (*i)->getType();
+ Type* curType = (*i)->getType();
if (curType == Type::getInt64Ty(*llvmContext)){
new StoreInst(*i, longLocals[index], false, currentBlock);
@@ -905,8 +899,8 @@
reader.seek(codeLen, Reader::SeekCur);
- const FunctionType *funcType = llvmFunction->getFunctionType();
- const Type* returnType = funcType->getReturnType();
+ FunctionType *funcType = llvmFunction->getFunctionType();
+ Type* returnType = funcType->getReturnType();
Function* func = llvmFunction;
@@ -929,8 +923,7 @@
new BitCastInst(returnValue, intrinsics->ptrPtrType, "", currentBlock);
Value* GCArgs[2] = { cast, intrinsics->constantPtrNull };
- CallInst::Create(intrinsics->llvm_gc_gcroot, GCArgs, GCArgs + 2, "",
- currentBlock);
+ CallInst::Create(intrinsics->llvm_gc_gcroot, GCArgs, "", currentBlock);
}
for (int i = 0; i < maxLocals; i++) {
@@ -980,7 +973,7 @@
for (;count < max; ++i, ++index, ++count, ++type) {
const Typedef* cur = arguments[type];
- const llvm::Type* curType = i->getType();
+ Type* curType = i->getType();
if (curType == Type::getInt64Ty(*llvmContext)){
new StoreInst(i, longLocals[index], false, currentBlock);
@@ -1174,7 +1167,7 @@
return llvmFunction;
}
-void JavaJIT::compareFP(Value* val1, Value* val2, const Type* ty, bool l) {
+void JavaJIT::compareFP(Value* val1, Value* val2, Type* ty, bool l) {
Value* one = intrinsics->constantOne;
Value* zero = intrinsics->constantZero;
Value* minus = intrinsics->constantMinusOne;
@@ -1208,7 +1201,7 @@
push(val, false, upcalls->newString);
} else {
// Lookup the constant pool cache
- const llvm::Type* Ty = PointerType::getUnqual(intrinsics->JavaObjectType);
+ Type* Ty = PointerType::getUnqual(intrinsics->JavaObjectType);
Value* val = getConstantPoolAt(index, intrinsics->StringLookupFunction,
Ty, 0, false);
val = new LoadInst(val, "", currentBlock);
@@ -1261,7 +1254,7 @@
}
Value* JavaJIT::verifyAndComputePtr(Value* obj, Value* index,
- const Type* arrayType, bool verif) {
+ Type* arrayType, bool verif) {
JITVerifyNull(obj);
if (index->getType() != Type::getInt32Ty(*llvmContext)) {
@@ -1395,8 +1388,7 @@
"tmp1", currentBlock);
} else if (name->equals(loader->atan2)) {
return llvm::CallInst::Create(intrinsics->func_llvm_atan2_f64,
- args.begin(), args.end(), "tmp1",
- currentBlock);
+ args, "tmp1", currentBlock);
} else if (name->equals(loader->exp)) {
return llvm::CallInst::Create(intrinsics->func_llvm_exp_f64, args[0],
"tmp1", currentBlock);
@@ -1404,8 +1396,8 @@
return llvm::CallInst::Create(intrinsics->func_llvm_log_f64, args[0],
"tmp1", currentBlock);
} else if (name->equals(loader->pow)) {
- return llvm::CallInst::Create(intrinsics->func_llvm_pow_f64, args.begin(),
- args.end(), "tmp1", currentBlock);
+ return llvm::CallInst::Create(intrinsics->func_llvm_pow_f64, args,
+ "tmp1", currentBlock);
} else if (name->equals(loader->ceil)) {
return llvm::CallInst::Create(intrinsics->func_llvm_ceil_f64, args[0], "tmp1",
currentBlock);
@@ -1468,7 +1460,7 @@
ctpInfo->nameOfStaticOrSpecialMethod(index, cl, name, signature);
LLVMSignatureInfo* LSI = TheCompiler->getSignatureInfo(signature);
- const llvm::FunctionType* virtualType = LSI->getVirtualType();
+ FunctionType* virtualType = LSI->getVirtualType();
meth = ctpInfo->infoOfStaticOrSpecialMethod(index, ACC_VIRTUAL, signature);
Value* func = 0;
@@ -1506,7 +1498,7 @@
val = invoke(func, args, "", currentBlock);
}
- const llvm::Type* retType = virtualType->getReturnType();
+ Type* retType = virtualType->getReturnType();
if (retType != Type::getVoidTy(*llvmContext)) {
if (retType == intrinsics->JavaObjectType) {
JnjvmClassLoader* JCL = compilingClass->classLoader;
@@ -1528,7 +1520,7 @@
const UTF8* className = 0;
ctpInfo->nameOfStaticOrSpecialMethod(index, className, name, signature);
LLVMSignatureInfo* LSI = TheCompiler->getSignatureInfo(signature);
- const llvm::FunctionType* staticType = LSI->getStaticType();
+ FunctionType* staticType = LSI->getStaticType();
ctpInfo->markAsStaticCall(index);
JnjvmBootstrapLoader* loader = compilingClass->classLoader->bootstrapLoader;
llvm::Instruction* val = 0;
@@ -1574,7 +1566,7 @@
}
}
- const llvm::Type* retType = staticType->getReturnType();
+ Type* retType = staticType->getReturnType();
if (retType != Type::getVoidTy(*llvmContext)) {
if (retType == intrinsics->JavaObjectType) {
JnjvmClassLoader* JCL = compilingClass->classLoader;
@@ -1590,7 +1582,7 @@
}
Value* JavaJIT::getConstantPoolAt(uint32 index, Function* resolver,
- const Type* returnType,
+ Type* returnType,
Value* additionalArg, bool doThrow) {
// This makes unswitch loop very unhappy time-wise, but makes GVN happy
@@ -1611,11 +1603,11 @@
res = invoke(intrinsics->GetConstantPoolAtFunction, Args, "",
currentBlock);
} else {
- res = CallInst::Create(intrinsics->GetConstantPoolAtFunction, Args.begin(),
- Args.end(), "", currentBlock);
+ res = CallInst::Create(intrinsics->GetConstantPoolAtFunction, Args,
+ "", currentBlock);
}
- const Type* realType =
+ Type* realType =
intrinsics->GetConstantPoolAtFunction->getReturnType();
if (returnType == Type::getInt32Ty(*llvmContext)) {
return new PtrToIntInst(res, Type::getInt32Ty(*llvmContext), "", currentBlock);
@@ -1725,14 +1717,14 @@
}
Value* JavaJIT::ldResolved(uint16 index, bool stat, Value* object,
- const Type* fieldTypePtr) {
+ Type* fieldTypePtr) {
JavaConstantPool* info = compilingClass->ctpInfo;
JavaField* field = info->lookupField(index, stat);
if (field && field->classDef->isResolved()) {
LLVMClassInfo* LCI = TheCompiler->getClassInfo(field->classDef);
LLVMFieldInfo* LFI = TheCompiler->getFieldInfo(field);
- const Type* type = 0;
+ Type* type = NULL;
if (stat) {
type = LCI->getStaticType();
Value* Cl = TheCompiler->getNativeClass(field->classDef);
@@ -1762,13 +1754,13 @@
return ptr;
}
- const Type* Pty = intrinsics->arrayPtrType;
+ Type* Pty = intrinsics->arrayPtrType;
Constant* zero = intrinsics->constantZero;
Function* func = stat ? intrinsics->StaticFieldLookupFunction :
intrinsics->VirtualFieldLookupFunction;
- const Type* returnType = 0;
+ Type* returnType = NULL;
if (stat) {
returnType = intrinsics->ptrType;
} else {
@@ -1787,9 +1779,9 @@
return new BitCastInst(ptr, fieldTypePtr, "", currentBlock);
}
-void JavaJIT::convertValue(Value*& val, const Type* t1, BasicBlock* currentBlock,
+void JavaJIT::convertValue(Value*& val, Type* t1, BasicBlock* currentBlock,
bool usign) {
- const Type* t2 = val->getType();
+ Type* t2 = val->getType();
if (t1 != t2) {
if (t1->isIntegerTy() && t2->isIntegerTy()) {
if (t2->getPrimitiveSizeInBits() < t1->getPrimitiveSizeInBits()) {
@@ -1817,7 +1809,7 @@
void JavaJIT::setStaticField(uint16 index) {
Typedef* sign = compilingClass->ctpInfo->infoOfField(index);
LLVMAssessorInfo& LAI = TheCompiler->getTypedefInfo(sign);
- const Type* type = LAI.llvmType;
+ Type* type = LAI.llvmType;
Value* ptr = ldResolved(index, true, NULL, LAI.llvmTypePtr);
@@ -1835,7 +1827,7 @@
ptr = new BitCastInst(ptr, intrinsics->ptrPtrType, "", currentBlock);
val = new BitCastInst(val, intrinsics->ptrType, "", currentBlock);
Value* args[2] = { ptr, val };
- CallInst::Create(intrinsics->NonHeapWriteBarrierFunction, args, args + 2, "", currentBlock);
+ CallInst::Create(intrinsics->NonHeapWriteBarrierFunction, args, "", currentBlock);
} else {
new StoreInst(val, ptr, false, currentBlock);
}
@@ -1844,7 +1836,7 @@
void JavaJIT::getStaticField(uint16 index) {
Typedef* sign = compilingClass->ctpInfo->infoOfField(index);
LLVMAssessorInfo& LAI = TheCompiler->getTypedefInfo(sign);
- const Type* type = LAI.llvmType;
+ Type* type = LAI.llvmType;
Value* ptr = ldResolved(index, true, NULL, LAI.llvmTypePtr);
@@ -1916,7 +1908,7 @@
void JavaJIT::setVirtualField(uint16 index) {
Typedef* sign = compilingClass->ctpInfo->infoOfField(index);
LLVMAssessorInfo& LAI = TheCompiler->getTypedefInfo(sign);
- const Type* type = LAI.llvmType;
+ Type* type = LAI.llvmType;
int stackIndex = currentStackIndex - 2;
if (type == Type::getInt64Ty(*llvmContext) ||
type == Type::getDoubleTy(*llvmContext)) {
@@ -1942,7 +1934,7 @@
object = new LoadInst(object, "", currentBlock);
object = new BitCastInst(object, intrinsics->ptrType, "", currentBlock);
Value* args[3] = { object, ptr, val };
- CallInst::Create(intrinsics->FieldWriteBarrierFunction, args, args + 3, "", currentBlock);
+ CallInst::Create(intrinsics->FieldWriteBarrierFunction, args, "", currentBlock);
} else {
new StoreInst(val, ptr, false, currentBlock);
}
@@ -1954,7 +1946,7 @@
CommonClass* cl = sign->findAssocClass(JCL);
LLVMAssessorInfo& LAI = TheCompiler->getTypedefInfo(sign);
- const Type* type = LAI.llvmType;
+ Type* type = LAI.llvmType;
Value* obj = objectStack[currentStackIndex - 1];
pop(); // Pop the object
@@ -2012,10 +2004,10 @@
Signdef* signature = ctpInfo->infoOfInterfaceOrVirtualMethod(index, name);
LLVMSignatureInfo* LSI = TheCompiler->getSignatureInfo(signature);
- const llvm::FunctionType* virtualType = LSI->getVirtualType();
- const llvm::PointerType* virtualPtrType = LSI->getVirtualPtrType();
+ FunctionType* virtualType = LSI->getVirtualType();
+ PointerType* virtualPtrType = LSI->getVirtualPtrType();
- const llvm::Type* retType = virtualType->getReturnType();
+ Type* retType = virtualType->getReturnType();
CommonClass* cl = 0;
JavaMethod* meth = 0;
@@ -2079,7 +2071,7 @@
Constant* MinusTwo = ConstantInt::get(intrinsics->pointerSizeType, -2);
BinaryOperator* int32_25 = BinaryOperator::Create(Instruction::And, int32_19,
MinusTwo, "", currentBlock);
- const PointerType* Ty = PointerType::getUnqual(intrinsics->JavaMethodType);
+ PointerType* Ty = PointerType::getUnqual(intrinsics->JavaMethodType);
CastInst* ptr_26 = new IntToPtrInst(int32_25, Ty, "", currentBlock);
LoadInst* int32_27 = new LoadInst(ptr_26, "", false, currentBlock);
ICmpInst* int1_28 = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, int32_27,
@@ -2402,8 +2394,7 @@
const char* Name,
BasicBlock *InsertAtEnd) {
- Instruction* res = CallInst::Create(F, args.begin(), args.end(), Name,
- InsertAtEnd);
+ Instruction* res = CallInst::Create(F, args, Name, InsertAtEnd);
DebugLoc DL = CreateLocation();
res->setDebugLoc(DL);
@@ -2503,7 +2494,7 @@
Value* args[2] = { arg1, arg2 };
- Instruction* res = CallInst::Create(F, args, args + 2, Name, InsertAtEnd);
+ Instruction* res = CallInst::Create(F, args, Name, InsertAtEnd);
DebugLoc DL = CreateLocation();
res->setDebugLoc(DL);
@@ -2629,7 +2620,7 @@
void JavaJIT::throwException(llvm::Function* F, Value** args,
uint32 nbArgs) {
- Instruction* obj = CallInst::Create(F, args, args + nbArgs, "", currentBlock);
+ Instruction* obj = CallInst::Create(F, ArrayRef<Value*>(args, nbArgs), "", currentBlock);
DebugLoc DL = CreateLocation();
obj->setDebugLoc(DL);
@@ -2794,8 +2785,7 @@
Value* classArgs[2] = { objVT, VTVar };
cmp = CallInst::Create(intrinsics->IsSecondaryClassFunction,
- classArgs, classArgs + 2, "",
- currentBlock);
+ classArgs, "", currentBlock);
} else {
@@ -2804,8 +2794,7 @@
Value* displayArgs[2] = { inDisplay, depthCl };
Value* VTInDisplay = CallInst::Create(intrinsics->GetVTInDisplayFunction,
- displayArgs, displayArgs + 2, "",
- currentBlock);
+ displayArgs, "", currentBlock);
cmp = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, VTInDisplay, VTVar,
"");
Modified: vmkit/trunk/lib/J3/Compiler/JavaJIT.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJIT.h?rev=135703&r1=135702&r2=135703&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaJIT.h (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaJIT.h Thu Jul 21 15:58:12 2011
@@ -134,7 +134,7 @@
}
/// convertValue - Convert a value to a new type.
- void convertValue(llvm::Value*& val, const llvm::Type* t1,
+ void convertValue(llvm::Value*& val, llvm::Type* t1,
llvm::BasicBlock* currentBlock, bool usign);
/// getMutatorThreadPtr - Emit code to get a pointer to the current MutatorThread.
@@ -222,11 +222,11 @@
/// verifyAndComputePtr - Computes the address in the array. If out of bounds
/// throw an exception.
llvm::Value* verifyAndComputePtr(llvm::Value* obj, llvm::Value* index,
- const llvm::Type* arrayType,
+ llvm::Type* arrayType,
bool verif = true);
/// compareFP - Do float comparisons.
- void compareFP(llvm::Value*, llvm::Value*, const llvm::Type*, bool l);
+ void compareFP(llvm::Value*, llvm::Value*, llvm::Type*, bool l);
//===------------------------- Stack manipulation -------------------------===//
@@ -242,7 +242,7 @@
/// push - Push a new value in the stack.
void push(llvm::Value* val, bool unsign, CommonClass* cl = 0) {
- const llvm::Type* type = val->getType();
+ llvm::Type* type = val->getType();
if (unsign) {
val = new llvm::ZExtInst(val, llvm::Type::getInt32Ty(*llvmContext), "", currentBlock);
new llvm::StoreInst(val, intStack[currentStackIndex++], false,
@@ -435,7 +435,7 @@
/// ldResolved - Emit code to get a pointer to a field.
llvm::Value* ldResolved(uint16 index, bool stat, llvm::Value* object,
- const llvm::Type* fieldTypePtr);
+ llvm::Type* fieldTypePtr);
//===--------------------- Constant pool accesses ------------------------===//
@@ -454,7 +454,7 @@
/// pool. The generated code invokes the resolver if the constant pool
/// contains no value at the index.
llvm::Value* getConstantPoolAt(uint32 index, llvm::Function* resolver,
- const llvm::Type* returnType,
+ llvm::Type* returnType,
llvm::Value* addArg, bool doThrow = true);
//===----------------------- Java method calls ---------------------------===//
Modified: vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp?rev=135703&r1=135702&r2=135703&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaJITCompiler.cpp Thu Jul 21 15:58:12 2011
@@ -92,7 +92,7 @@
Constant* JavaJITCompiler::getNativeClass(CommonClass* classDef) {
- const llvm::Type* Ty = classDef->isClass() ? JavaIntrinsics.JavaClassType :
+ Type* Ty = classDef->isClass() ? JavaIntrinsics.JavaClassType :
JavaIntrinsics.JavaCommonClassType;
ConstantInt* CI = ConstantInt::get(Type::getInt64Ty(getLLVMContext()),
@@ -122,7 +122,7 @@
Constant* JavaJITCompiler::getStringPtr(JavaString** str) {
assert(str && "No string given");
- const llvm::Type* Ty = PointerType::getUnqual(JavaIntrinsics.JavaObjectType);
+ Type* Ty = PointerType::getUnqual(JavaIntrinsics.JavaObjectType);
ConstantInt* CI = ConstantInt::get(Type::getInt64Ty(getLLVMContext()),
uint64(str));
return ConstantExpr::getIntToPtr(CI, Ty);
@@ -139,7 +139,7 @@
assert(obj && "Delegatee not created");
Constant* CI = ConstantInt::get(Type::getInt64Ty(getLLVMContext()),
uint64(obj));
- const Type* Ty = PointerType::getUnqual(JavaIntrinsics.JavaObjectType);
+ Type* Ty = PointerType::getUnqual(JavaIntrinsics.JavaObjectType);
return ConstantExpr::getIntToPtr(CI, Ty);
}
@@ -182,7 +182,7 @@
Constant* JavaJITCompiler::getNativeFunction(JavaMethod* meth, void* ptr) {
LLVMSignatureInfo* LSI = getSignatureInfo(meth->getSignature());
- const llvm::Type* valPtrType = LSI->getNativePtrType();
+ Type* valPtrType = LSI->getNativePtrType();
assert(ptr && "No native function given");
Modified: vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp?rev=135703&r1=135702&r2=135703&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/JavaJITOpcodes.cpp Thu Jul 21 15:58:12 2011
@@ -164,7 +164,7 @@
};
- CallInst::Create(intrinsics->PrintExecutionFunction, args, args + 3, "",
+ CallInst::Create(intrinsics->PrintExecutionFunction, args, "",
currentBlock);
}
#endif
@@ -707,7 +707,7 @@
Value* VTArgs[2] = { valVT, objVT };
Value* res = CallInst::Create(intrinsics->IsAssignableFromFunction,
- VTArgs, VTArgs + 2, "", currentBlock);
+ VTArgs, "", currentBlock);
BranchInst::Create(endBlock, exceptionBlock, res, currentBlock);
@@ -726,7 +726,7 @@
val = new BitCastInst(val, intrinsics->ptrType, "", currentBlock);
obj = new BitCastInst(obj, intrinsics->ptrType, "", currentBlock);
Value* args[3] = { obj, ptr, val };
- CallInst::Create(intrinsics->ArrayWriteBarrierFunction, args, args + 3, "", currentBlock);
+ CallInst::Create(intrinsics->ArrayWriteBarrierFunction, args, "", currentBlock);
} else {
new StoreInst(val, ptr, false, currentBlock);
}
@@ -748,7 +748,7 @@
case CASTORE : {
Value* val = pop();
- const Type* type = val->getType();
+ Type* type = val->getType();
if (type == Type::getInt32Ty(*llvmContext)) {
val = new TruncInst(val, Type::getInt16Ty(*llvmContext), "", currentBlock);
} else if (type == Type::getInt8Ty(*llvmContext)) {
@@ -764,7 +764,7 @@
case SASTORE : {
Value* val = pop();
- const Type* type = val->getType();
+ Type* type = val->getType();
if (type == Type::getInt32Ty(*llvmContext)) {
val = new TruncInst(val, Type::getInt16Ty(*llvmContext), "", currentBlock);
} else if (type == Type::getInt8Ty(*llvmContext)) {
@@ -1635,7 +1635,7 @@
BasicBlock* ifTrue = ifTrueInfo.newBlock;
Value* op = pop();
- const Type* type = op->getType();
+ Type* type = op->getType();
Constant* val = Constant::getNullValue(type);
llvm::Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, op,
val, "");
@@ -1652,7 +1652,7 @@
BasicBlock* ifTrue = ifTrueInfo.newBlock;
Value* op = pop();
- const Type* type = op->getType();
+ Type* type = op->getType();
Constant* val = Constant::getNullValue(type);
llvm::Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_NE, op,
val, "");
@@ -1668,7 +1668,7 @@
i += 2;
BasicBlock* ifTrue = ifTrueInfo.newBlock;
Value* op = pop();
- const Type* type = op->getType();
+ Type* type = op->getType();
Constant* val = Constant::getNullValue(type);
llvm::Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_SLT, op,
val, "");
@@ -1684,7 +1684,7 @@
i += 2;
BasicBlock* ifTrue = ifTrueInfo.newBlock;
Value* op = pop();
- const Type* type = op->getType();
+ Type* type = op->getType();
Constant* val = Constant::getNullValue(type);
llvm::Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_SGE, op,
val, "");
@@ -1700,7 +1700,7 @@
i += 2;
BasicBlock* ifTrue = ifTrueInfo.newBlock;
Value* op = pop();
- const Type* type = op->getType();
+ Type* type = op->getType();
Constant* val = Constant::getNullValue(type);
llvm::Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_SGT, op,
val, "");
@@ -1716,7 +1716,7 @@
i += 2;
BasicBlock* ifTrue = ifTrueInfo.newBlock;
Value* op = pop();
- const Type* type = op->getType();
+ Type* type = op->getType();
Constant* val = Constant::getNullValue(type);
llvm::Value* test = new ICmpInst(*currentBlock, ICmpInst::ICMP_SLE, op,
val, "");
@@ -1902,7 +1902,7 @@
Value* index = pop();
- const llvm::Type* type = index->getType();
+ Type* type = index->getType();
for (sint32 cur = low; cur < high; ++cur) {
Value* cmp = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ,
ConstantInt::get(type, cur), index, "");
@@ -2071,7 +2071,7 @@
Value* args[2] = { isolateLocal,
ConstantInt::get(Type::getInt32Ty(*llvmContext), id - 4) };
valCl = CallInst::Create(intrinsics->GetJnjvmArrayClassFunction,
- args, args + 2, "", currentBlock);
+ args, "", currentBlock);
#endif
LLVMAssessorInfo& LAI = TheCompiler->AssessorInfo[charId];
@@ -2111,13 +2111,13 @@
}
} else {
- const llvm::Type* Ty =
+ Type* Ty =
PointerType::getUnqual(intrinsics->VTType);
Value* args[3]= { TheCompiler->getNativeClass(compilingClass),
ConstantInt::get(Type::getInt32Ty(*llvmContext), index),
Constant::getNullValue(Ty) };
TheVT = CallInst::Create(intrinsics->GetArrayClassFunction, args,
- args + 3, "", currentBlock);
+ "", currentBlock);
}
sizeElement = intrinsics->constantPtrLogSize;
@@ -2248,8 +2248,7 @@
if (cl) {
if (cl->isSecondaryClass()) {
res = CallInst::Create(intrinsics->IsSecondaryClassFunction,
- classArgs, classArgs + 2, "",
- currentBlock);
+ classArgs, "", currentBlock);
} else {
Value* inDisplay = CallInst::Create(intrinsics->GetDisplayFunction,
objVT, "", currentBlock);
@@ -2259,16 +2258,14 @@
Value* displayArgs[2] = { inDisplay, CI };
Value* VTInDisplay =
CallInst::Create(intrinsics->GetVTInDisplayFunction,
- displayArgs, displayArgs + 2, "",
- currentBlock);
+ displayArgs, "", currentBlock);
res = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ, VTInDisplay,
TheVT, "");
}
} else {
res = CallInst::Create(intrinsics->IsAssignableFromFunction,
- classArgs, classArgs + 2, "",
- currentBlock);
+ classArgs, "", currentBlock);
}
node->addIncoming(res, currentBlock);
Modified: vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp?rev=135703&r1=135702&r2=135703&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/LLVMInfo.cpp Thu Jul 21 15:58:12 2011
@@ -379,8 +379,7 @@
currentBlock);
}
- Value* val = CallInst::Create(func, Args.begin(), Args.end(), "",
- currentBlock);
+ Value* val = CallInst::Create(func, Args, "", currentBlock);
if (!signature->getReturnType()->isVoid()) {
ReturnInst::Create(context, val, currentBlock);
} else {
@@ -452,8 +451,7 @@
Args.push_back(arg);
}
- Value* val = CallInst::Create(func, Args.begin(), Args.end(), "",
- currentBlock);
+ Value* val = CallInst::Create(func, Args, "", currentBlock);
if (!signature->getReturnType()->isVoid()) {
ReturnInst::Create(context, val, currentBlock);
} else {
@@ -507,8 +505,7 @@
Intrinsics.constantPtrNull
};
- CallInst::Create(Intrinsics.llvm_gc_gcroot, GCArgs, GCArgs + 2, "",
- currentBlock);
+ CallInst::Create(Intrinsics.llvm_gc_gcroot, GCArgs, "", currentBlock);
}
TempArgs.push_back(temp);
@@ -525,7 +522,7 @@
Value* val = CallInst::Create(virt ? Intrinsics.ResolveVirtualStubFunction :
special ? Intrinsics.ResolveSpecialStubFunction:
Intrinsics.ResolveStaticStubFunction,
- Args.begin(), Args.end(), "", currentBlock);
+ Args, "", currentBlock);
Constant* nullValue = Constant::getNullValue(val->getType());
Value* cmp = new ICmpInst(*currentBlock, ICmpInst::ICMP_EQ,
@@ -547,8 +544,7 @@
}
FunctionArgs.push_back(temp);
}
- Value* res = CallInst::Create(Func, FunctionArgs.begin(), FunctionArgs.end(),
- "", currentBlock);
+ Value* res = CallInst::Create(Func, FunctionArgs, "", currentBlock);
if (node) node->addIncoming(res, currentBlock);
BranchInst::Create(endBlock, currentBlock);
Modified: vmkit/trunk/lib/J3/Compiler/LLVMMaterializer.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/LLVMMaterializer.cpp?rev=135703&r1=135702&r2=135703&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/LLVMMaterializer.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/LLVMMaterializer.cpp Thu Jul 21 15:58:12 2011
@@ -91,7 +91,7 @@
F = TheModule->getFunction(key);
if (F) return F;
- const FunctionType* type = stat ? LSI->getStaticType() :
+ FunctionType* type = stat ? LSI->getStaticType() :
LSI->getVirtualType();
F = Function::Create(type, GlobalValue::ExternalWeakLinkage, key, TheModule);
Modified: vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp?rev=135703&r1=135702&r2=135703&view=diff
==============================================================================
--- vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp (original)
+++ vmkit/trunk/lib/J3/Compiler/LowerConstantCalls.cpp Thu Jul 21 15:58:12 2011
@@ -290,7 +290,7 @@
intrinsics->OffsetDisplayInVTConstant };
Value* DisplayPtr = GetElementPtrInst::Create(val, indexes,
indexes + 2, "", CI);
- const llvm::Type* Ty = PointerType::getUnqual(intrinsics->VTType);
+ Type* Ty = PointerType::getUnqual(intrinsics->VTType);
DisplayPtr = new BitCastInst(DisplayPtr, Ty, "", CI);
CI->replaceAllUsesWith(DisplayPtr);
CI->eraseFromParent();
@@ -363,8 +363,7 @@
BasicBlock* UI = Invoke->getUnwindDest();
res = InvokeInst::Create(intrinsics->InitialiseClassFunction,
- trueCl, UI, Args, Args + 1,
- "", falseCl);
+ trueCl, UI, Args, "", falseCl);
// For some reason, an LLVM pass may add PHI nodes to the
// exception destination.
@@ -403,7 +402,7 @@
} else if (V == intrinsics->GetConstantPoolAtFunction) {
Function* resolver = dyn_cast<Function>(Call.getArgument(0));
assert(resolver && "Wrong use of GetConstantPoolAt");
- const Type* returnType = resolver->getReturnType();
+ Type* returnType = resolver->getReturnType();
Value* CTP = Call.getArgument(1);
Value* Index = Call.getArgument(3);
Changed = true;
@@ -438,8 +437,7 @@
Instruction* res = 0;
if (InvokeInst* Invoke = dyn_cast<InvokeInst>(CI)) {
BasicBlock* UI = Invoke->getUnwindDest();
- res = InvokeInst::Create(resolver, trueCl, UI, Args.begin(),
- Args.end(), "", falseCl);
+ res = InvokeInst::Create(resolver, trueCl, UI, Args, "", falseCl);
// For some reason, an LLVM pass may add PHI nodes to the
// exception destination.
@@ -462,8 +460,7 @@
}
} else {
- res = CallInst::Create(resolver, Args.begin(), Args.end(), "",
- falseCl);
+ res = CallInst::Create(resolver, Args, "", falseCl);
BranchInst::Create(trueCl, falseCl);
}
@@ -475,7 +472,7 @@
BranchInst::Create(NBB, trueCl);
break;
} else if (V == intrinsics->GetArrayClassFunction) {
- const llvm::Type* Ty = PointerType::getUnqual(intrinsics->VTType);
+ Type* Ty = PointerType::getUnqual(intrinsics->VTType);
Constant* nullValue = Constant::getNullValue(Ty);
// Check if we have already proceed this call.
if (Call.getArgument(2) == nullValue) {
@@ -502,7 +499,7 @@
Value* args[3] = { Call.getArgument(0), Call.getArgument(1), GV };
Instruction* res = CallInst::Create(intrinsics->GetArrayClassFunction, args,
- args + 3, "", NotOKBlock);
+ "", NotOKBlock);
res->setDebugLoc(CI->getDebugLoc());
BranchInst::Create(OKBlock, NotOKBlock);
node->addIncoming(res, NotOKBlock);
@@ -561,7 +558,7 @@
Value* Args[2] = { VT1, VT2 };
res = CallInst::Create(intrinsics->IsSecondaryClassFunction, Args,
- Args + 2, "", FailedBlock);
+ "", FailedBlock);
res->setDebugLoc(CI->getDebugLoc());
node->addIncoming(res, FailedBlock);
@@ -592,7 +589,7 @@
BasicBlock* BB6 = BasicBlock::Create(*Context, "BB6", &F);
BasicBlock* BB7 = BasicBlock::Create(*Context, "BB7", &F);
BasicBlock* BB9 = BasicBlock::Create(*Context, "BB9", &F);
- const Type* Ty = PointerType::getUnqual(intrinsics->VTType);
+ Type* Ty = PointerType::getUnqual(intrinsics->VTType);
PHINode* resFwd = PHINode::Create(Type::getInt32Ty(*Context), 2, "", BB7);
Modified: vmkit/trunk/lib/Mvm/Compiler/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/Compiler/JIT.cpp?rev=135703&r1=135702&r2=135703&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/Compiler/JIT.cpp (original)
+++ vmkit/trunk/lib/Mvm/Compiler/JIT.cpp Thu Jul 21 15:58:12 2011
@@ -310,7 +310,7 @@
mvm::BumpPtrAllocator* MvmModule::Allocator;
//unsigned MvmModule::MetadataTypeKind;
-uint64 MvmModule::getTypeSize(const llvm::Type* type) {
+uint64 MvmModule::getTypeSize(llvm::Type* type) {
return TheTargetData->getTypeAllocSize(type);
}
Modified: vmkit/trunk/mmtk/magic/LowerMagic.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/magic/LowerMagic.cpp?rev=135703&r1=135702&r2=135703&view=diff
==============================================================================
--- vmkit/trunk/mmtk/magic/LowerMagic.cpp (original)
+++ vmkit/trunk/mmtk/magic/LowerMagic.cpp Thu Jul 21 15:58:12 2011
@@ -459,7 +459,7 @@
!strcmp(FCur->getName().data(), AddressStoreWordMethod)) {
Value* Addr = Call.getArgument(0);
Value* Obj = Call.getArgument(1);
- const llvm::Type* Ty = PointerType::getUnqual(Obj->getType());
+ Type* Ty = PointerType::getUnqual(Obj->getType());
Addr = new BitCastInst(Addr, Ty, "", CI);
new StoreInst(Obj, Addr, CI);
CI->eraseFromParent();
@@ -471,7 +471,7 @@
!strcmp(FCur->getName().data(), AddressLoadIntMethod) ||
!strcmp(FCur->getName().data(), AddressPrepareWordMethod)) {
Value* Addr = Call.getArgument(0);
- const Type* Ty = PointerType::getUnqual(FCur->getReturnType());
+ Type* Ty = PointerType::getUnqual(FCur->getReturnType());
Addr = new BitCastInst(Addr, Ty, "", CI);
Value* LD = new LoadInst(Addr, "", CI);
CI->replaceAllUsesWith(LD);
@@ -584,13 +584,13 @@
Ptr = new PtrToIntInst(Ptr, pointerSizeType, "", CI);
Offset = new PtrToIntInst(Offset, pointerSizeType, "", CI);
Ptr = BinaryOperator::CreateAdd(Ptr, Offset, "", CI);
- const Type* Ty = PointerType::getUnqual(pointerSizeType);
+ Type* Ty = PointerType::getUnqual(pointerSizeType);
Ptr = new IntToPtrInst(Ptr, Ty, "", CI);
Old = new PtrToIntInst(Old, pointerSizeType, "", CI);
Val = new PtrToIntInst(Val, pointerSizeType, "", CI);
Value* Args[3] = { Ptr, Old, Val };
- Value* res = CallInst::Create(CASPtr, Args, Args + 3, "", CI);
+ Value* res = CallInst::Create(CASPtr, Args, "", CI);
res = new ICmpInst(CI, ICmpInst::ICMP_EQ, res, Old, "");
res = new ZExtInst(res, FCur->getReturnType(), "", CI);
@@ -601,13 +601,13 @@
Value* Old = Call.getArgument(1);
Value* Val = Call.getArgument(2);
- const Type* Ty = PointerType::getUnqual(pointerSizeType);
+ Type* Ty = PointerType::getUnqual(pointerSizeType);
Ptr = new BitCastInst(Ptr, Ty, "", CI);
Old = new PtrToIntInst(Old, pointerSizeType, "", CI);
Val = new PtrToIntInst(Val, pointerSizeType, "", CI);
Value* Args[3] = { Ptr, Old, Val };
- Value* res = CallInst::Create(CASPtr, Args, Args + 3, "", CI);
+ Value* res = CallInst::Create(CASPtr, Args, "", CI);
res = new ICmpInst(CI, ICmpInst::ICMP_EQ, res, Old, "");
res = new ZExtInst(res, FCur->getReturnType(), "", CI);
@@ -626,7 +626,7 @@
Ptr = new PtrToIntInst(Ptr, pointerSizeType, "", CI);
Offset = new PtrToIntInst(Offset, pointerSizeType, "", CI);
Ptr = BinaryOperator::CreateAdd(Ptr, Offset, "", CI);
- const Type* Ty = PointerType::getUnqual(FCur->getReturnType());
+ Type* Ty = PointerType::getUnqual(FCur->getReturnType());
Ptr = new IntToPtrInst(Ptr, Ty, "", CI);
Value* res = new LoadInst(Ptr, "", CI);
@@ -643,7 +643,7 @@
Ptr = new PtrToIntInst(Ptr, pointerSizeType, "", CI);
Offset = new PtrToIntInst(Offset, pointerSizeType, "", CI);
Ptr = BinaryOperator::CreateAdd(Ptr, Offset, "", CI);
- const Type* Ty = PointerType::getUnqual(Val->getType());
+ Type* Ty = PointerType::getUnqual(Val->getType());
Ptr = new IntToPtrInst(Ptr, Ty, "", CI);
new StoreInst(Val, Ptr, CI);
@@ -1197,7 +1197,7 @@
Length = BinaryOperator::CreateShl(Length, constantPtrLogSize, "", CI);
Val = new IntToPtrInst(Val, ptrType, "", CI);
Value* args[2] = { Length, Val };
- Value* res = CallInst::Create(MMalloc, args, args + 2, "", CI);
+ Value* res = CallInst::Create(MMalloc, args, "", CI);
res = new BitCastInst(res, FCur->getReturnType(), "", CI);
CI->replaceAllUsesWith(res);
CI->eraseFromParent();
More information about the vmkit-commits
mailing list