From 3aae575a248d012e0dc95f4d34a3b155cc4ca578 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Sun, 13 Mar 2016 08:01:03 +0000 Subject: [PATCH] [Bitcode] Make writeComdats less strange It had a weird artificial limitation on the write side: the comdat name couldn't be bigger than 2**16. However, the reader had no such limitation. Make the reader and the writer agree. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263377 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bitcode/Writer/BitcodeWriter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp index 84d09635d1c..2e13958fdb1 100644 --- a/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -580,12 +580,12 @@ static unsigned getEncodedComdatSelectionKind(const Comdat &C) { } static void writeComdats(const ValueEnumerator &VE, BitstreamWriter &Stream) { - SmallVector Vals; + SmallVector Vals; for (const Comdat *C : VE.getComdats()) { // COMDAT: [selection_kind, name] Vals.push_back(getEncodedComdatSelectionKind(*C)); size_t Size = C->getName().size(); - assert(isUInt<16>(Size)); + assert(isUInt<32>(Size)); Vals.push_back(Size); for (char Chr : C->getName()) Vals.push_back((unsigned char)Chr);