Make the generated code for ConstantInt nicer.
llvm-svn: 35902
This commit is contained in:
parent
c49f2ef236
commit
5899dd1dc3
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue