[llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp
Chris Lattner
sabre at nondot.org
Sat May 5 17:53:36 PDT 2007
Changes in directory llvm/lib/Bitcode/Reader:
BitcodeReader.cpp updated: 1.42 -> 1.43
---
Log message:
add a denser encoding for null terminated strings, add a 6-bit abbrev as
well. This shrinks kc++ from 2724088 to 2717360 bytes.
---
Diffs of the changes: (+14 -0)
BitcodeReader.cpp | 14 ++++++++++++++
1 files changed, 14 insertions(+)
Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.42 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.43
--- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.42 Sat May 5 19:35:24 2007
+++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Sat May 5 19:53:07 2007
@@ -651,9 +651,23 @@
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;
}
More information about the llvm-commits
mailing list