[llvm-commits] [SignlessTypes] CVS: llvm/lib/Transforms/TransformInternals.cpp

Reid Spencer reid at x10sys.com
Wed Oct 18 20:59:01 PDT 2006



Changes in directory llvm/lib/Transforms:

TransformInternals.cpp updated: 1.50 -> 1.50.8.1
---
Log message:

For PR950: http://llvm.org/PR950 :
This commit (on SignlessTypes branch) provides the first Iteration for 
moving LLVM away from Signed types. This patch removes the ConstantSInt
and ConstantUInt classes from Type.h and makes all necessary changes in
LLVM to compensate.


---
Diffs of the changes:  (+5 -4)

 TransformInternals.cpp |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)


Index: llvm/lib/Transforms/TransformInternals.cpp
diff -u llvm/lib/Transforms/TransformInternals.cpp:1.50 llvm/lib/Transforms/TransformInternals.cpp:1.50.8.1
--- llvm/lib/Transforms/TransformInternals.cpp:1.50	Fri Oct 28 23:41:30 2005
+++ llvm/lib/Transforms/TransformInternals.cpp	Wed Oct 18 22:57:56 2006
@@ -34,7 +34,7 @@
          (i == SL->MemberOffsets.size()-1 || Offset < SL->MemberOffsets[i+1]));
 
   // Make sure to save the current index...
-  Indices.push_back(ConstantUInt::get(Type::UIntTy, i));
+  Indices.push_back(ConstantInt::get(Type::UIntTy, uint32_t(i)));
   Offset = SL->MemberOffsets[i];
   return STy->getContainedType(i);
 }
@@ -73,10 +73,11 @@
 
     NextType = ATy->getElementType();
     unsigned ChildSize = (unsigned)TD.getTypeSize(NextType);
-    if (ConstantSInt::isValueValidForType(Type::IntTy, Offset/ChildSize))
-      Indices.push_back(ConstantSInt::get(Type::IntTy, Offset/ChildSize));
+    if (ConstantInt::isValueValidForType(Type::IntTy, 
+                                         uint64_t(Offset/ChildSize)))
+      Indices.push_back(ConstantInt::get(Type::IntTy, Offset/ChildSize));
     else
-      Indices.push_back(ConstantSInt::get(Type::LongTy, Offset/ChildSize));
+      Indices.push_back(ConstantInt::get(Type::LongTy, Offset/ChildSize));
     ThisOffset = (Offset/ChildSize)*ChildSize;
   } else {
     Offset = 0;   // Return the offset that we were able to achieve






More information about the llvm-commits mailing list