summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LowerGC.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
commit43ad6b3e0d6ada51e9b23aab3e061187f1f5710c (patch)
treeaccb30ee96c29fc9e1021feaa850a435b60f81fc /lib/Transforms/Scalar/LowerGC.cpp
parent303dae993aba2474a23753ed66737b8c38cc97a0 (diff)
downloadllvm-43ad6b3e0d6ada51e9b23aab3e061187f1f5710c.tar.gz
llvm-43ad6b3e0d6ada51e9b23aab3e061187f1f5710c.tar.bz2
llvm-43ad6b3e0d6ada51e9b23aab3e061187f1f5710c.tar.xz
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/Scalar/LowerGC.cpp')
-rw-r--r--lib/Transforms/Scalar/LowerGC.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/LowerGC.cpp b/lib/Transforms/Scalar/LowerGC.cpp
index 9935a84cda..e7a9997bc1 100644
--- a/lib/Transforms/Scalar/LowerGC.cpp
+++ b/lib/Transforms/Scalar/LowerGC.cpp
@@ -86,7 +86,7 @@ const StructType *LowerGC::getRootRecordType(unsigned NumRoots) {
PATypeHolder RootListH =
MainRootRecordType ? (Type*)MainRootRecordType : (Type*)OpaqueType::get();
ST.clear();
- ST.push_back(PointerType::get(RootListH)); // Prev pointer
+ ST.push_back(PointerType::getUnqual(RootListH)); // Prev pointer
ST.push_back(Type::Int32Ty); // NumElements in array
ST.push_back(PairArrTy); // The pairs
StructType *RootList = StructType::get(ST);
@@ -107,8 +107,8 @@ bool LowerGC::doInitialization(Module &M) {
GCWriteInt = M.getFunction("llvm.gcwrite");
if (!GCRootInt && !GCReadInt && !GCWriteInt) return false;
- PointerType *VoidPtr = PointerType::get(Type::Int8Ty);
- PointerType *VoidPtrPtr = PointerType::get(VoidPtr);
+ PointerType *VoidPtr = PointerType::getUnqual(Type::Int8Ty);
+ PointerType *VoidPtrPtr = PointerType::getUnqual(VoidPtr);
// If the program is using read/write barriers, find the implementations of
// them from the GC runtime library.
@@ -122,7 +122,7 @@ bool LowerGC::doInitialization(Module &M) {
// If the program has GC roots, get or create the global root list.
if (GCRootInt) {
const StructType *RootListTy = getRootRecordType(0);
- const Type *PRLTy = PointerType::get(RootListTy);
+ const Type *PRLTy = PointerType::getUnqual(RootListTy);
M.addTypeName("llvm_gc_root_ty", RootListTy);
// Get the root chain if it already exists.
@@ -163,8 +163,8 @@ bool LowerGC::runOnFunction(Function &F) {
// Quick exit for programs that are not using GC mechanisms.
if (!GCRootInt && !GCReadInt && !GCWriteInt) return false;
- PointerType *VoidPtr = PointerType::get(Type::Int8Ty);
- PointerType *VoidPtrPtr = PointerType::get(VoidPtr);
+ PointerType *VoidPtr = PointerType::getUnqual(Type::Int8Ty);
+ PointerType *VoidPtrPtr = PointerType::getUnqual(VoidPtr);
// If there are read/write barriers in the program, perform a quick pass over
// the function eliminating them. While we are at it, remember where we see
@@ -290,7 +290,7 @@ bool LowerGC::runOnFunction(Function &F) {
// Now that the record is all initialized, store the pointer into the global
// pointer.
- Value *C = new BitCastInst(AI, PointerType::get(MainRootRecordType), "", IP);
+ Value *C = new BitCastInst(AI, PointerType::getUnqual(MainRootRecordType), "", IP);
new StoreInst(C, RootChain, IP);
// Eliminate all the gcroot records now.