Add support for comdats with names larger than 256 characters.
llvm-svn: 226012
This commit is contained in:
@@ -549,11 +549,13 @@ static unsigned getEncodedComdatSelectionKind(const Comdat &C) {
|
||||
}
|
||||
|
||||
static void writeComdats(const ValueEnumerator &VE, BitstreamWriter &Stream) {
|
||||
SmallVector<uint8_t, 64> Vals;
|
||||
SmallVector<uint16_t, 64> Vals;
|
||||
for (const Comdat *C : VE.getComdats()) {
|
||||
// COMDAT: [selection_kind, name]
|
||||
Vals.push_back(getEncodedComdatSelectionKind(*C));
|
||||
Vals.push_back(C->getName().size());
|
||||
size_t Size = C->getName().size();
|
||||
assert(isUInt<16>(Size));
|
||||
Vals.push_back(Size);
|
||||
for (char Chr : C->getName())
|
||||
Vals.push_back((unsigned char)Chr);
|
||||
Stream.EmitRecord(bitc::MODULE_CODE_COMDAT, Vals, /*AbbrevToUse=*/0);
|
||||
|
||||
Reference in New Issue
Block a user