mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-30 04:35:00 +00:00
Make output for ConstantInt construction correct for any bitwidth.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34809 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0d54b7df4f
commit
7029725851
@ -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…
x
Reference in New Issue
Block a user