summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LowerGC.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-31 05:48:39 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-31 05:48:39 +0000
commitc5b206b6be61d0d933b98b6af5e22f42edd48ad1 (patch)
tree9e6a1e6d3b90890de3d1464a44a7cef8d30fe1ae /lib/Transforms/Scalar/LowerGC.cpp
parent05e52a1b35e7feb359a176af462591697c4d9647 (diff)
downloadllvm-c5b206b6be61d0d933b98b6af5e22f42edd48ad1.tar.gz
llvm-c5b206b6be61d0d933b98b6af5e22f42edd48ad1.tar.bz2
llvm-c5b206b6be61d0d933b98b6af5e22f42edd48ad1.tar.xz
For PR950:
This patch replaces signed integer types with signless ones: 1. [US]Byte -> Int8 2. [U]Short -> Int16 3. [U]Int -> Int32 4. [U]Long -> Int64. 5. Removal of isSigned, isUnsigned, getSignedVersion, getUnsignedVersion and other methods related to signedness. In a few places this warranted identifying the signedness information from other sources. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32785 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LowerGC.cpp')
-rw-r--r--lib/Transforms/Scalar/LowerGC.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Transforms/Scalar/LowerGC.cpp b/lib/Transforms/Scalar/LowerGC.cpp
index e844213b6a..e0d6933821 100644
--- a/lib/Transforms/Scalar/LowerGC.cpp
+++ b/lib/Transforms/Scalar/LowerGC.cpp
@@ -83,7 +83,7 @@ const StructType *LowerGC::getRootRecordType(unsigned NumRoots) {
MainRootRecordType ? (Type*)MainRootRecordType : (Type*)OpaqueType::get();
ST.clear();
ST.push_back(PointerType::get(RootListH)); // Prev pointer
- ST.push_back(Type::UIntTy); // NumElements in array
+ ST.push_back(Type::Int32Ty); // NumElements in array
ST.push_back(PairArrTy); // The pairs
StructType *RootList = StructType::get(ST);
if (MainRootRecordType)
@@ -103,7 +103,7 @@ bool LowerGC::doInitialization(Module &M) {
GCWriteInt = M.getNamedFunction("llvm.gcwrite");
if (!GCRootInt && !GCReadInt && !GCWriteInt) return false;
- PointerType *VoidPtr = PointerType::get(Type::SByteTy);
+ PointerType *VoidPtr = PointerType::get(Type::Int8Ty);
PointerType *VoidPtrPtr = PointerType::get(VoidPtr);
// If the program is using read/write barriers, find the implementations of
@@ -159,7 +159,7 @@ 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::SByteTy);
+ PointerType *VoidPtr = PointerType::get(Type::Int8Ty);
PointerType *VoidPtrPtr = PointerType::get(VoidPtr);
// If there are read/write barriers in the program, perform a quick pass over
@@ -225,8 +225,8 @@ bool LowerGC::runOnFunction(Function &F) {
BasicBlock::iterator IP = AI;
while (isa<AllocaInst>(IP)) ++IP;
- Constant *Zero = ConstantInt::get(Type::UIntTy, 0);
- Constant *One = ConstantInt::get(Type::UIntTy, 1);
+ Constant *Zero = ConstantInt::get(Type::Int32Ty, 0);
+ Constant *One = ConstantInt::get(Type::Int32Ty, 1);
// Get a pointer to the prev pointer.
std::vector<Value*> Par;
@@ -240,11 +240,11 @@ bool LowerGC::runOnFunction(Function &F) {
new StoreInst(PrevPtr, PrevPtrPtr, IP);
// Set the number of elements in this record.
- Par[1] = ConstantInt::get(Type::UIntTy, 1);
+ Par[1] = ConstantInt::get(Type::Int32Ty, 1);
Value *NumEltsPtr = new GetElementPtrInst(AI, Par, "numeltsptr", IP);
- new StoreInst(ConstantInt::get(Type::UIntTy, GCRoots.size()), NumEltsPtr,IP);
+ new StoreInst(ConstantInt::get(Type::Int32Ty, GCRoots.size()), NumEltsPtr,IP);
- Par[1] = ConstantInt::get(Type::UIntTy, 2);
+ Par[1] = ConstantInt::get(Type::Int32Ty, 2);
Par.resize(4);
const PointerType *PtrLocTy =
@@ -254,7 +254,7 @@ bool LowerGC::runOnFunction(Function &F) {
// Initialize all of the gcroot records now, and eliminate them as we go.
for (unsigned i = 0, e = GCRoots.size(); i != e; ++i) {
// Initialize the meta-data pointer.
- Par[2] = ConstantInt::get(Type::UIntTy, i);
+ Par[2] = ConstantInt::get(Type::Int32Ty, i);
Par[3] = One;
Value *MetaDataPtr = new GetElementPtrInst(AI, Par, "MetaDataPtr", IP);
assert(isa<Constant>(GCRoots[i]->getOperand(2)) && "Must be a constant");