Make output for ConstantInt construction correct for any bitwidth.
llvm-svn: 34809
This commit is contained in:
parent
4326cf5c51
commit
07761199e0
|
@ -665,7 +665,8 @@ void CppWriter::printConstant(const Constant *CV) {
|
|||
}
|
||||
if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
|
||||
Out << "ConstantInt* " << constName << " = ConstantInt::get("
|
||||
<< typeName << ", " << CI->getZExtValue() << ");";
|
||||
<< "APInt(cast<IntegerTyp>(" << typeName << ")->getBitWidth(),"
|
||||
<< " \"" << CI->getValue().toStringSigned(10) << "\", 10));";
|
||||
} else if (isa<ConstantAggregateZero>(CV)) {
|
||||
Out << "ConstantAggregateZero* " << constName
|
||||
<< " = ConstantAggregateZero::get(" << typeName << ");";
|
||||
|
|
Loading…
Reference in New Issue