mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +00:00
implement the 'string constant' optimization. This shrinks kc.bit from
2878544 to 2815788 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36818 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -484,6 +484,12 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal,
|
||||
assert (CFP->getType() == Type::DoubleTy && "Unknown FP type!");
|
||||
Record.push_back(DoubleToBits((double)CFP->getValue()));
|
||||
}
|
||||
} else if (isa<ConstantArray>(C) && cast<ConstantArray>(C)->isString()) {
|
||||
// Emit constant strings specially.
|
||||
Code = bitc::CST_CODE_STRING;
|
||||
for (unsigned i = 0, e = C->getNumOperands(); i != e; ++i)
|
||||
Record.push_back(cast<ConstantInt>(C->getOperand(i))->getZExtValue());
|
||||
|
||||
} else if (isa<ConstantArray>(C) || isa<ConstantStruct>(V) ||
|
||||
isa<ConstantVector>(V)) {
|
||||
Code = bitc::CST_CODE_AGGREGATE;
|
||||
|
Reference in New Issue
Block a user