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;
}
if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
Out << "ConstantInt* " << constName << " = ConstantInt::get("
<< "APInt(cast<IntegerType>(" << typeName << ")->getBitWidth(),"
Out << "ConstantInt* " << constName << " = ConstantInt::get(APInt("
<< cast<IntegerType>(CI->getType())->getBitWidth() << ", "
<< " \"" << CI->getValue().toStringSigned(10) << "\", 10));";
} else if (isa<ConstantAggregateZero>(CV)) {
Out << "ConstantAggregateZero* " << constName