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
This commit is contained in:
Reid Spencer 2006-12-19 21:16:35 +00:00
parent 44ef93449a
commit 2acb8e1a43
1 changed files with 1 additions and 4 deletions

View File

@ -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();
} 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