diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-10-20 07:07:24 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-10-20 07:07:24 +0000 |
commit | b83eb6447ba155342598f0fabe1f08f5baa9164a (patch) | |
tree | a5822f5fdac89033b7b16ba8e5aaf1ae10833b1c /lib/VMCore/AsmWriter.cpp | |
parent | 6e7dd9db6bf677c9161a6ecc12f90651cf1231e0 (diff) | |
download | external_llvm-b83eb6447ba155342598f0fabe1f08f5baa9164a.zip external_llvm-b83eb6447ba155342598f0fabe1f08f5baa9164a.tar.gz external_llvm-b83eb6447ba155342598f0fabe1f08f5baa9164a.tar.bz2 |
For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/AsmWriter.cpp')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index aedb2c4..d4a43ce 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -422,10 +422,11 @@ static void WriteConstantInt(std::ostream &Out, const Constant *CV, static std::string Indent = "\n"; if (const ConstantBool *CB = dyn_cast<ConstantBool>(CV)) { Out << (CB->getValue() ? "true" : "false"); - } else if (const ConstantSInt *CI = dyn_cast<ConstantSInt>(CV)) { - Out << CI->getValue(); - } else if (const ConstantUInt *CI = dyn_cast<ConstantUInt>(CV)) { - Out << CI->getValue(); + } else if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) { + if (CI->getType()->isSigned()) + Out << CI->getSExtValue(); + else + Out << CI->getZExtValue(); } 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 |