mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-11 08:29:25 +00:00
Add support for comdats with names larger than 256 characters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226012 91177308-0d34-0410-b5e6-96231b3b80d8
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