summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-19 21:16:35 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-19 21:16:35 +0000
commit2acb8e1a437d94ad108db1f4b8c8deb4af3e5f6f (patch)
tree36887ef4b9f2fceae99ebd120963ce300554a96d /llvm
parent44ef93449a5a266e52b0849e9980cdbf27d3e0f5 (diff)
downloadbcm5719-llvm-2acb8e1a437d94ad108db1f4b8c8deb4af3e5f6f.tar.gz
bcm5719-llvm-2acb8e1a437d94ad108db1f4b8c8deb4af3e5f6f.zip
Now that ConstantInt::isValueValidForType can handle signed and unsigned
values regardless of the signedness of the constant's type, it is okay to always make the AsmWriter.cpp print constant ints as signed values. The AsmParser will automatically handle things like: uint -1 as a result. llvm-svn: 32686
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index 1647f51da96..268d3f5cfc2 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -434,10 +434,7 @@ static void WriteConstantInt(std::ostream &Out, const Constant *CV,
if (const ConstantBool *CB = dyn_cast<ConstantBool>(CV)) {
Out << (CB->getValue() ? "true" : "false");
} else if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
- if (CI->getType()->isSigned())
- Out << CI->getSExtValue();
- else
- Out << CI->getZExtValue();
+ 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