From bb2f2222b45179d8ddd0c7d481ad9dc068c82b6c Mon Sep 17 00:00:00 2001 From: Christopher Lamb Date: Mon, 17 Dec 2007 01:12:55 +0000 Subject: 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 --- lib/Transforms/IPO/RaiseAllocations.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/Transforms/IPO/RaiseAllocations.cpp') diff --git a/lib/Transforms/IPO/RaiseAllocations.cpp b/lib/Transforms/IPO/RaiseAllocations.cpp index e6d8723f45..ca4be9e528 100644 --- a/lib/Transforms/IPO/RaiseAllocations.cpp +++ b/lib/Transforms/IPO/RaiseAllocations.cpp @@ -78,7 +78,7 @@ void RaiseAllocations::doInitialization(Module &M) { // Get the expected prototype for malloc const FunctionType *Malloc1Type = - FunctionType::get(PointerType::get(Type::Int8Ty), + FunctionType::get(PointerType::getUnqual(Type::Int8Ty), std::vector(1, Type::Int64Ty), false); // Chck to see if we got the expected malloc @@ -86,14 +86,14 @@ void RaiseAllocations::doInitialization(Module &M) { // Check to see if the prototype is wrong, giving us sbyte*(uint) * malloc // This handles the common declaration of: 'void *malloc(unsigned);' const FunctionType *Malloc2Type = - FunctionType::get(PointerType::get(Type::Int8Ty), + FunctionType::get(PointerType::getUnqual(Type::Int8Ty), std::vector(1, Type::Int32Ty), false); if (TyWeHave != Malloc2Type) { // Check to see if the prototype is missing, giving us // sbyte*(...) * malloc // This handles the common declaration of: 'void *malloc();' const FunctionType *Malloc3Type = - FunctionType::get(PointerType::get(Type::Int8Ty), + FunctionType::get(PointerType::getUnqual(Type::Int8Ty), std::vector(), true); if (TyWeHave != Malloc3Type) // Give up @@ -108,7 +108,7 @@ void RaiseAllocations::doInitialization(Module &M) { // Get the expected prototype for void free(i8*) const FunctionType *Free1Type = FunctionType::get(Type::VoidTy, - std::vector(1, PointerType::get(Type::Int8Ty)), false); + std::vector(1, PointerType::getUnqual(Type::Int8Ty)), false); if (TyWeHave != Free1Type) { // Check to see if the prototype was forgotten, giving us @@ -219,7 +219,8 @@ bool RaiseAllocations::runOnModule(Module &M) { // Value *Source = *CS.arg_begin(); if (!isa(Source->getType())) - Source = new IntToPtrInst(Source, PointerType::get(Type::Int8Ty), + Source = new IntToPtrInst(Source, + PointerType::getUnqual(Type::Int8Ty), "FreePtrCast", I); new FreeInst(Source, I); -- cgit v1.2.3