[llvm] r263377 - [Bitcode] Make writeComdats less strange

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 13 00:01:04 PST 2016


Author: majnemer
Date: Sun Mar 13 03:01:03 2016
New Revision: 263377

URL: http://llvm.org/viewvc/llvm-project?rev=263377&view=rev
Log:
[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.

Modified:
    llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp

Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=263377&r1=263376&r2=263377&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Sun Mar 13 03:01:03 2016
@@ -580,12 +580,12 @@ static unsigned getEncodedComdatSelectio
 }
 
 static void writeComdats(const ValueEnumerator &VE, BitstreamWriter &Stream) {
-  SmallVector<uint16_t, 64> Vals;
+  SmallVector<unsigned, 64> 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);




More information about the llvm-commits mailing list