mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 04:25:43 +00:00
add a denser encoding for null terminated strings, add a 6-bit abbrev as
well. This shrinks kc++ from 2724088 to 2717360 bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36821 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -651,12 +651,26 @@ bool BitcodeReader::ParseConstants() {
|
||||
|
||||
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_CSTRING: { // CSTRING: [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]));
|
||||
Elts.push_back(Constant::getNullValue(EltTy));
|
||||
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