mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +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:
@ -642,7 +642,21 @@ bool BitcodeReader::ParseConstants() {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case bitc::CST_CODE_STRING: { // STRING: [values]
|
||||
if (Record.empty())
|
||||
return Error("Invalid CST_AGGREGATE record");
|
||||
|
||||
const ArrayType *ATy = cast<ArrayType>(CurTy);
|
||||
const Type *EltTy = ATy->getElementType();
|
||||
|
||||
unsigned Size = Record.size();
|
||||
std::vector<Constant*> Elts;
|
||||
|
||||
for (unsigned i = 0; i != Size; ++i)
|
||||
Elts.push_back(ConstantInt::get(EltTy, Record[i]));
|
||||
V = ConstantArray::get(ATy, Elts);
|
||||
break;
|
||||
}
|
||||
case bitc::CST_CODE_CE_BINOP: { // CE_BINOP: [opcode, opval, opval]
|
||||
if (Record.size() < 3) return Error("Invalid CE_BINOP record");
|
||||
int Opc = GetDecodedBinaryOpcode(Record[0], CurTy);
|
||||
|
Reference in New Issue
Block a user