[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp

Reid Spencer reid at x10sys.com
Tue Dec 19 13:16:50 PST 2006



Changes in directory llvm/lib/VMCore:

AsmWriter.cpp updated: 1.229 -> 1.230
---
Log message:

Now that ConstantInt::isValueValidForType can handle signed and unsigned
values regardless of the signedness of the constant's type, it is okay to
always make the AsmWriter.cpp print constant ints as signed values. The
AsmParser will automatically handle things like: uint -1 as a result.


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

 AsmWriter.cpp |    5 +----
 1 files changed, 1 insertion(+), 4 deletions(-)


Index: llvm/lib/VMCore/AsmWriter.cpp
diff -u llvm/lib/VMCore/AsmWriter.cpp:1.229 llvm/lib/VMCore/AsmWriter.cpp:1.230
--- llvm/lib/VMCore/AsmWriter.cpp:1.229	Fri Dec  8 12:06:15 2006
+++ llvm/lib/VMCore/AsmWriter.cpp	Tue Dec 19 15:16:35 2006
@@ -434,10 +434,7 @@
   if (const ConstantBool *CB = dyn_cast<ConstantBool>(CV)) {
     Out << (CB->getValue() ? "true" : "false");
   } else if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
-    if (CI->getType()->isSigned())
-      Out << CI->getSExtValue();
-    else
-      Out << CI->getZExtValue();
+    Out << CI->getSExtValue();
   } else if (const ConstantFP *CFP = dyn_cast<ConstantFP>(CV)) {
     // We would like to output the FP constant value in exponential notation,
     // but we cannot do this if doing so will lose precision.  Check here to






More information about the llvm-commits mailing list