From: Reid Spencer Date: Tue, 19 Dec 2006 21:16:35 +0000 (+0000) Subject: Now that ConstantInt::isValueValidForType can handle signed and unsigned X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9d908e8ca0314a8952b562de9d7e44bcf71426b1;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32686 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 1647f51da96..268d3f5cfc2 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -434,10 +434,7 @@ static void WriteConstantInt(std::ostream &Out, const Constant *CV, if (const ConstantBool *CB = dyn_cast(CV)) { Out << (CB->getValue() ? "true" : "false"); } else if (const ConstantInt *CI = dyn_cast(CV)) { - if (CI->getType()->isSigned()) - Out << CI->getSExtValue(); - else - Out << CI->getZExtValue(); + Out << CI->getSExtValue(); } else if (const ConstantFP *CFP = dyn_cast(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