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.
llvm-svn: 33110
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index fed85b3..d7a134e 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter.cpp
@@ -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)) {
diff --git a/llvm/lib/CodeGen/MachineDebugInfo.cpp b/llvm/lib/CodeGen/MachineDebugInfo.cpp
index 2ebd64b..0a6d3ac 100644
--- a/llvm/lib/CodeGen/MachineDebugInfo.cpp
+++ b/llvm/lib/CodeGen/MachineDebugInfo.cpp
@@ -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));