[llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp
Chris Lattner
sabre at nondot.org
Thu Sep 28 16:19:43 PDT 2006
Changes in directory llvm/lib/Target/CBackend:
Writer.cpp updated: 1.271 -> 1.272
---
Log message:
Simplify some code, reformat break's
---
Diffs of the changes: (+12 -6)
Writer.cpp | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
Index: llvm/lib/Target/CBackend/Writer.cpp
diff -u llvm/lib/Target/CBackend/Writer.cpp:1.271 llvm/lib/Target/CBackend/Writer.cpp:1.272
--- llvm/lib/Target/CBackend/Writer.cpp:1.271 Sun Sep 17 15:25:45 2006
+++ llvm/lib/Target/CBackend/Writer.cpp Thu Sep 28 18:19:29 2006
@@ -638,10 +638,12 @@
switch (CPV->getType()->getTypeID()) {
case Type::BoolTyID:
- Out << (CPV == ConstantBool::False ? '0' : '1'); break;
+ Out << (cast<ConstantBool>(CPV)->getValue() ? '1' : '0');
+ break;
case Type::SByteTyID:
case Type::ShortTyID:
- Out << cast<ConstantSInt>(CPV)->getValue(); break;
+ Out << cast<ConstantSInt>(CPV)->getValue();
+ break;
case Type::IntTyID:
if ((int)cast<ConstantSInt>(CPV)->getValue() == (int)0x80000000)
Out << "((int)0x80000000U)"; // Handle MININT specially to avoid warning
@@ -653,15 +655,19 @@
if (cast<ConstantSInt>(CPV)->isMinValue())
Out << "(/*INT64_MIN*/(-9223372036854775807LL)-1)";
else
- Out << cast<ConstantSInt>(CPV)->getValue() << "ll"; break;
+ Out << cast<ConstantSInt>(CPV)->getValue() << "ll";
+ break;
case Type::UByteTyID:
case Type::UShortTyID:
- Out << cast<ConstantUInt>(CPV)->getValue(); break;
+ Out << cast<ConstantUInt>(CPV)->getValue();
+ break;
case Type::UIntTyID:
- Out << cast<ConstantUInt>(CPV)->getValue() << 'u'; break;
+ Out << cast<ConstantUInt>(CPV)->getValue() << 'u';
+ break;
case Type::ULongTyID:
- Out << cast<ConstantUInt>(CPV)->getValue() << "ull"; break;
+ Out << cast<ConstantUInt>(CPV)->getValue() << "ull";
+ break;
case Type::FloatTyID:
case Type::DoubleTyID: {
More information about the llvm-commits
mailing list