aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/IPO/RaiseAllocations.cpp
diff options
context:
space:
mode:
authorChristopher Lamb <christopher.lamb@gmail.com>2007-12-17 01:12:55 +0000
committerChristopher Lamb <christopher.lamb@gmail.com>2007-12-17 01:12:55 +0000
commitbb2f2222b45179d8ddd0c7d481ad9dc068c82b6c (patch)
treeaccb30ee96c29fc9e1021feaa850a435b60f81fc /lib/Transforms/IPO/RaiseAllocations.cpp
parentcfe0096362c9823c2164f445b898c4fcfd4831ad (diff)
downloadexternal_llvm-bb2f2222b45179d8ddd0c7d481ad9dc068c82b6c.tar.gz
external_llvm-bb2f2222b45179d8ddd0c7d481ad9dc068c82b6c.tar.bz2
external_llvm-bb2f2222b45179d8ddd0c7d481ad9dc068c82b6c.zip
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
Diffstat (limited to 'lib/Transforms/IPO/RaiseAllocations.cpp')
-rw-r--r--lib/Transforms/IPO/RaiseAllocations.cpp11
1 files changed, 6 insertions, 5 deletions
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<const Type*>(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<const Type*>(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<const Type*>(), 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<const Type*>(1, PointerType::get(Type::Int8Ty)), false);
+ std::vector<const Type*>(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<PointerType>(Source->getType()))
- Source = new IntToPtrInst(Source, PointerType::get(Type::Int8Ty),
+ Source = new IntToPtrInst(Source,
+ PointerType::getUnqual(Type::Int8Ty),
"FreePtrCast", I);
new FreeInst(Source, I);