[llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon May 12 10:40:01 PDT 2003


Changes in directory llvm/lib/CWriter:

Writer.cpp updated: 1.84 -> 1.85

---
Log message:

Fix bug: CWriter/2003-05-12-IntegerSizeWarning.c


---
Diffs of the changes:

Index: llvm/lib/CWriter/Writer.cpp
diff -u llvm/lib/CWriter/Writer.cpp:1.84 llvm/lib/CWriter/Writer.cpp:1.85
--- llvm/lib/CWriter/Writer.cpp:1.84	Thu May  8 13:41:45 2003
+++ llvm/lib/CWriter/Writer.cpp	Mon May 12 10:39:31 2003
@@ -380,8 +380,14 @@
     Out << (CPV == ConstantBool::False ? "0" : "1"); break;
   case Type::SByteTyID:
   case Type::ShortTyID:
-  case Type::IntTyID:
     Out << cast<ConstantSInt>(CPV)->getValue(); break;
+  case Type::IntTyID:
+    if ((int)cast<ConstantSInt>(CPV)->getValue() == (int)0x80000000)
+      Out << "((int)0x80000000)";   // Handle MININT specially to avoid warning
+    else
+      Out << cast<ConstantSInt>(CPV)->getValue();
+    break;
+
   case Type::LongTyID:
     Out << cast<ConstantSInt>(CPV)->getValue() << "ll"; break;
 





More information about the llvm-commits mailing list