diff options
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r-- | lib/Transforms/Utils/CodeExtractor.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/Utils/InlineFunction.cpp | 2 | ||||
-rw-r--r-- | lib/Transforms/Utils/LowerAllocations.cpp | 7 | ||||
-rw-r--r-- | lib/Transforms/Utils/LowerInvoke.cpp | 11 |
4 files changed, 13 insertions, 11 deletions
diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp index c42d5e177d..98b3f2b940 100644 --- a/lib/Transforms/Utils/CodeExtractor.cpp +++ b/lib/Transforms/Utils/CodeExtractor.cpp @@ -263,7 +263,7 @@ Function *CodeExtractor::constructFunction(const Values &inputs, if (AggregateArgs) paramTy.push_back((*I)->getType()); else - paramTy.push_back(PointerType::get((*I)->getType())); + paramTy.push_back(PointerType::getUnqual((*I)->getType())); } DOUT << "Function type: " << *RetTy << " f("; @@ -273,7 +273,7 @@ Function *CodeExtractor::constructFunction(const Values &inputs, DOUT << ")\n"; if (AggregateArgs && (inputs.size() + outputs.size() > 0)) { - PointerType *StructPtr = PointerType::get(StructType::get(paramTy)); + PointerType *StructPtr = PointerType::getUnqual(StructType::get(paramTy)); paramTy.clear(); paramTy.push_back(StructPtr); } diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp index e9f6b28e98..e88eb94282 100644 --- a/lib/Transforms/Utils/InlineFunction.cpp +++ b/lib/Transforms/Utils/InlineFunction.cpp @@ -277,7 +277,7 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD) { // code with llvm.stacksave/llvm.stackrestore intrinsics. if (InlinedFunctionInfo.ContainsDynamicAllocas) { Module *M = Caller->getParent(); - const Type *BytePtr = PointerType::get(Type::Int8Ty); + const Type *BytePtr = PointerType::getUnqual(Type::Int8Ty); // Get the two intrinsics we care about. Constant *StackSave, *StackRestore; StackSave = M->getOrInsertFunction("llvm.stacksave", BytePtr, NULL); diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp index b089cd6d8b..c5c8bd50da 100644 --- a/lib/Transforms/Utils/LowerAllocations.cpp +++ b/lib/Transforms/Utils/LowerAllocations.cpp @@ -87,7 +87,7 @@ Pass *llvm::createLowerAllocationsPass(bool LowerMallocArgToInteger) { // This function is always successful. // bool LowerAllocations::doInitialization(Module &M) { - const Type *BPTy = PointerType::get(Type::Int8Ty); + const Type *BPTy = PointerType::getUnqual(Type::Int8Ty); // Prototype malloc as "char* malloc(...)", because we don't know in // doInitialization whether size_t is int or long. FunctionType *FT = FunctionType::get(BPTy, std::vector<const Type*>(), true); @@ -158,8 +158,9 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) { Changed = true; ++NumLowered; } else if (FreeInst *FI = dyn_cast<FreeInst>(I)) { - Value *PtrCast = new BitCastInst(FI->getOperand(0), - PointerType::get(Type::Int8Ty), "", I); + Value *PtrCast = + new BitCastInst(FI->getOperand(0), + PointerType::getUnqual(Type::Int8Ty), "", I); // Insert a call to the free function... (new CallInst(FreeFunc, PtrCast, "", I))->setTailCall(); diff --git a/lib/Transforms/Utils/LowerInvoke.cpp b/lib/Transforms/Utils/LowerInvoke.cpp index 24b167ac87..db49b780fd 100644 --- a/lib/Transforms/Utils/LowerInvoke.cpp +++ b/lib/Transforms/Utils/LowerInvoke.cpp @@ -114,7 +114,7 @@ FunctionPass *llvm::createLowerInvokePass(const TargetLowering *TLI) { // doInitialization - Make sure that there is a prototype for abort in the // current module. bool LowerInvoke::doInitialization(Module &M) { - const Type *VoidPtrTy = PointerType::get(Type::Int8Ty); + const Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty); AbortMessage = 0; if (ExpensiveEHSupport) { // Insert a type for the linked list of jump buffers. @@ -126,14 +126,14 @@ bool LowerInvoke::doInitialization(Module &M) { std::vector<const Type*> Elements; Elements.push_back(JmpBufTy); OpaqueType *OT = OpaqueType::get(); - Elements.push_back(PointerType::get(OT)); + Elements.push_back(PointerType::getUnqual(OT)); PATypeHolder JBLType(StructType::get(Elements)); OT->refineAbstractTypeTo(JBLType.get()); // Complete the cycle. JBLinkTy = JBLType.get(); M.addTypeName("llvm.sjljeh.jmpbufty", JBLinkTy); } - const Type *PtrJBList = PointerType::get(JBLinkTy); + const Type *PtrJBList = PointerType::getUnqual(JBLinkTy); // Now that we've done that, insert the jmpbuf list head global, unless it // already exists. @@ -144,9 +144,10 @@ bool LowerInvoke::doInitialization(Module &M) { "llvm.sjljeh.jblist", &M); } SetJmpFn = M.getOrInsertFunction("llvm.setjmp", Type::Int32Ty, - PointerType::get(JmpBufTy), (Type *)0); + PointerType::getUnqual(JmpBufTy), + (Type *)0); LongJmpFn = M.getOrInsertFunction("llvm.longjmp", Type::VoidTy, - PointerType::get(JmpBufTy), + PointerType::getUnqual(JmpBufTy), Type::Int32Ty, (Type *)0); } |