summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/AsmWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/VMCore/AsmWriter.cpp')
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index a00b19edc96..99926f6c761 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -438,10 +438,10 @@ static void WriteConstantInt(std::ostream &Out, const Constant *CV,
SlotMachine *Machine) {
const int IndentSize = 4;
static std::string Indent = "\n";
- if (const ConstantBool *CB = dyn_cast<ConstantBool>(CV)) {
- Out << (CB->getValue() ? "true" : "false");
- } else if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
- Out << CI->getSExtValue();
+ if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
+ if (CI->getType() == Type::BoolTy)
+ Out << (CI->getBoolValue() ? "true" : "false");
+ else Out << CI->getSExtValue();
} else if (const ConstantFP *CFP = dyn_cast<ConstantFP>(CV)) {
// We would like to output the FP constant value in exponential notation,
// but we cannot do this if doing so will lose precision. Check here to
OpenPOWER on IntegriCloud