mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 02:24:22 +00:00
Change the PointerType api for creating pointer types. The old functionality of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45082 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user