1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Make the generated code for ConstantInt nicer.

llvm-svn: 35902
This commit is contained in:
Reid Spencer 2007-04-11 13:02:56 +00:00
parent 9b497be3c4
commit a9cb0e6602

View File

@ -694,8 +694,8 @@ void CppWriter::printConstant(const Constant *CV) {
return; return;
} }
if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) { if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
Out << "ConstantInt* " << constName << " = ConstantInt::get(" Out << "ConstantInt* " << constName << " = ConstantInt::get(APInt("
<< "APInt(cast<IntegerType>(" << typeName << ")->getBitWidth()," << cast<IntegerType>(CI->getType())->getBitWidth() << ", "
<< " \"" << CI->getValue().toStringSigned(10) << "\", 10));"; << " \"" << CI->getValue().toStringSigned(10) << "\", 10));";
} else if (isa<ConstantAggregateZero>(CV)) { } else if (isa<ConstantAggregateZero>(CV)) {
Out << "ConstantAggregateZero* " << constName Out << "ConstantAggregateZero* " << constName