[llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp
Zhou Sheng
zhousheng00 at gmail.com
Thu Jan 11 04:25:07 PST 2007
Changes in directory llvm/lib/Target/CBackend:
CBackend.cpp updated: 1.309 -> 1.310
---
Log message:
For PR1043: http://llvm.org/PR1043 :
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.
---
Diffs of the changes: (+13 -14)
CBackend.cpp | 27 +++++++++++++--------------
1 files changed, 13 insertions(+), 14 deletions(-)
Index: llvm/lib/Target/CBackend/CBackend.cpp
diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.309 llvm/lib/Target/CBackend/CBackend.cpp:1.310
--- llvm/lib/Target/CBackend/CBackend.cpp:1.309 Tue Jan 9 22:17:32 2007
+++ llvm/lib/Target/CBackend/CBackend.cpp Thu Jan 11 06:24:14 2007
@@ -826,22 +826,21 @@
return;
}
- if (ConstantBool *CB = dyn_cast<ConstantBool>(CPV)) {
- Out << (CB->getValue() ? '1' : '0') ;
- return;
- }
-
if (ConstantInt *CI = dyn_cast<ConstantInt>(CPV)) {
const Type* Ty = CI->getType();
- Out << "((";
- printPrimitiveType(Out, Ty, false) << ')';
- if (CI->isMinValue(true))
- Out << CI->getZExtValue() << 'u';
- else
- Out << CI->getSExtValue();
- if (Ty->getPrimitiveSizeInBits() > 32)
- Out << "ll";
- Out << ')';
+ if (Ty == Type::BoolTy)
+ Out << (CI->getBoolValue() ? '1' : '0') ;
+ else {
+ Out << "((";
+ printPrimitiveType(Out, Ty, false) << ')';
+ if (CI->isMinValue(true))
+ Out << CI->getZExtValue() << 'u';
+ else
+ Out << CI->getSExtValue();
+ if (Ty->getPrimitiveSizeInBits() > 32)
+ Out << "ll";
+ Out << ')';
+ }
return;
}
More information about the llvm-commits
mailing list