[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp MachineDebugInfo.cpp
Reid Spencer
reid at x10sys.com
Thu Jan 11 20:25:22 PST 2007
Changes in directory llvm/lib/CodeGen:
AsmPrinter.cpp updated: 1.131 -> 1.132
MachineDebugInfo.cpp updated: 1.68 -> 1.69
---
Log message:
Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that
get(bool) be replaced by get(const Type*, uint64_t). This implements
those changes.
---
Diffs of the changes: (+3 -3)
AsmPrinter.cpp | 2 +-
MachineDebugInfo.cpp | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.131 llvm/lib/CodeGen/AsmPrinter.cpp:1.132
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.131 Thu Jan 11 12:21:29 2007
+++ llvm/lib/CodeGen/AsmPrinter.cpp Thu Jan 11 22:24:45 2007
@@ -390,7 +390,7 @@
O << "0";
else if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
if (CI->getType() == Type::Int1Ty) {
- assert(CI->getBoolValue());
+ assert(CI->getZExtValue());
O << "1";
} else O << CI->getSExtValue();
} else if (const GlobalValue *GV = dyn_cast<GlobalValue>(CV)) {
Index: llvm/lib/CodeGen/MachineDebugInfo.cpp
diff -u llvm/lib/CodeGen/MachineDebugInfo.cpp:1.68 llvm/lib/CodeGen/MachineDebugInfo.cpp:1.69
--- llvm/lib/CodeGen/MachineDebugInfo.cpp:1.68 Thu Jan 11 12:21:29 2007
+++ llvm/lib/CodeGen/MachineDebugInfo.cpp Thu Jan 11 22:24:45 2007
@@ -211,7 +211,7 @@
}
virtual void Apply(bool &Field) {
Constant *C = CI->getOperand(I++);
- Field = cast<ConstantInt>(C)->getBoolValue();
+ Field = cast<ConstantInt>(C)->getZExtValue();
}
virtual void Apply(std::string &Field) {
Constant *C = CI->getOperand(I++);
@@ -276,7 +276,7 @@
Elements.push_back(ConstantInt::get(Type::Int64Ty, uint64_t(Field)));
}
virtual void Apply(bool &Field) {
- Elements.push_back(ConstantInt::get(Field));
+ Elements.push_back(ConstantInt::get(Type::Int1Ty, Field));
}
virtual void Apply(std::string &Field) {
Elements.push_back(SR.getString(Field));
More information about the llvm-commits
mailing list