[llvm-commits] [SignlessTypes] CVS: llvm/lib/Target/CBackend/Writer.cpp

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



Changes in directory llvm/lib/Target/CBackend:

Writer.cpp updated: 1.272 -> 1.272.2.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:  (+10 -10)

 Writer.cpp |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)


Index: llvm/lib/Target/CBackend/Writer.cpp
diff -u llvm/lib/Target/CBackend/Writer.cpp:1.272 llvm/lib/Target/CBackend/Writer.cpp:1.272.2.1
--- llvm/lib/Target/CBackend/Writer.cpp:1.272	Thu Sep 28 18:19:29 2006
+++ llvm/lib/Target/CBackend/Writer.cpp	Wed Oct 18 22:57:56 2006
@@ -642,31 +642,31 @@
     break;
   case Type::SByteTyID:
   case Type::ShortTyID:
-    Out << cast<ConstantSInt>(CPV)->getValue();
+    Out << cast<ConstantInt>(CPV)->getSExtValue();
     break;
   case Type::IntTyID:
-    if ((int)cast<ConstantSInt>(CPV)->getValue() == (int)0x80000000)
+    if ((int)cast<ConstantInt>(CPV)->getSExtValue() == (int)0x80000000)
       Out << "((int)0x80000000U)";   // Handle MININT specially to avoid warning
     else
-      Out << cast<ConstantSInt>(CPV)->getValue();
+      Out << cast<ConstantInt>(CPV)->getSExtValue();
     break;
 
   case Type::LongTyID:
-    if (cast<ConstantSInt>(CPV)->isMinValue())
+    if (cast<ConstantInt>(CPV)->isMinValue())
       Out << "(/*INT64_MIN*/(-9223372036854775807LL)-1)";
     else
-      Out << cast<ConstantSInt>(CPV)->getValue() << "ll";
+      Out << cast<ConstantInt>(CPV)->getSExtValue() << "ll";
     break;
 
   case Type::UByteTyID:
   case Type::UShortTyID:
-    Out << cast<ConstantUInt>(CPV)->getValue();
+    Out << cast<ConstantInt>(CPV)->getZExtValue();
     break;
   case Type::UIntTyID:
-    Out << cast<ConstantUInt>(CPV)->getValue() << 'u';
+    Out << cast<ConstantInt>(CPV)->getZExtValue() << 'u';
     break;
   case Type::ULongTyID:
-    Out << cast<ConstantUInt>(CPV)->getValue() << "ull";
+    Out << cast<ConstantInt>(CPV)->getZExtValue() << "ull";
     break;
 
   case Type::FloatTyID:
@@ -2002,14 +2002,14 @@
     // Print out the -> operator if possible...
     if (TmpI != E && isa<StructType>(*TmpI)) {
       Out << (HasImplicitAddress ? "." : "->");
-      Out << "field" << cast<ConstantUInt>(TmpI.getOperand())->getValue();
+      Out << "field" << cast<ConstantInt>(TmpI.getOperand())->getZExtValue();
       I = ++TmpI;
     }
   }
 
   for (; I != E; ++I)
     if (isa<StructType>(*I)) {
-      Out << ".field" << cast<ConstantUInt>(I.getOperand())->getValue();
+      Out << ".field" << cast<ConstantInt>(I.getOperand())->getZExtValue();
     } else {
       Out << '[';
       writeOperand(I.getOperand());






More information about the llvm-commits mailing list