diff options
author | Zhou Sheng <zhousheng00@gmail.com> | 2007-01-11 12:24:14 +0000 |
---|---|---|
committer | Zhou Sheng <zhousheng00@gmail.com> | 2007-01-11 12:24:14 +0000 |
commit | 6b6b6ef1677fa71b1072c2911b4c1f9524a558c9 (patch) | |
tree | 480ecf010ac5facd1bc29ab57441253691bb42d6 /lib/VMCore/AsmWriter.cpp | |
parent | 057809ac1c78c3456e8f1481330fa2bcd2b85029 (diff) | |
download | llvm-6b6b6ef1677fa71b1072c2911b4c1f9524a558c9.tar.gz llvm-6b6b6ef1677fa71b1072c2911b4c1f9524a558c9.tar.bz2 llvm-6b6b6ef1677fa71b1072c2911b4c1f9524a558c9.tar.xz |
For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/AsmWriter.cpp')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index a00b19edc9..99926f6c76 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/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 |