Object: Use offset+size as the irsymtab string representation.
This is consistent with the bitcode string table.
Differential Revision: https://reviews.llvm.org/D31922
llvm-svn: 300465
diff --git a/llvm/lib/Object/IRSymtab.cpp b/llvm/lib/Object/IRSymtab.cpp
index da1ef99..43e623a 100644
--- a/llvm/lib/Object/IRSymtab.cpp
+++ b/llvm/lib/Object/IRSymtab.cpp
@@ -28,7 +28,7 @@
Builder(SmallVector<char, 0> &Symtab, SmallVector<char, 0> &Strtab)
: Symtab(Symtab), Strtab(Strtab) {}
- StringTableBuilder StrtabBuilder{StringTableBuilder::ELF};
+ StringTableBuilder StrtabBuilder{StringTableBuilder::RAW};
BumpPtrAllocator Alloc;
StringSaver Saver{Alloc};
@@ -49,6 +49,7 @@
void setStr(storage::Str &S, StringRef Value) {
S.Offset = StrtabBuilder.add(Value);
+ S.Size = Value.size();
}
template <typename T>
void writeRange(storage::Range<T> &R, const std::vector<T> &Objs) {