[llvm] r261019 - Bitcode writer: fix a typo, using getName() instead of getSourceFileName()

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 16 14:07:04 PST 2016


Author: mehdi_amini
Date: Tue Feb 16 16:07:03 2016
New Revision: 261019

URL: http://llvm.org/viewvc/llvm-project?rev=261019&view=rev
Log:
Bitcode writer: fix a typo, using getName() instead of getSourceFileName()

When emitting the source filename, the encoding of the string
was checked against the name instead of the filename.

From: Mehdi Amini <mehdi.amini at apple.com>

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=261019&r1=261018&r2=261019&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Tue Feb 16 16:07:03 2016
@@ -821,8 +821,8 @@ static uint64_t WriteModuleInfo(const Mo
 
   // Emit the module's source file name.
   {
-    StringEncoding Bits =
-        getStringEncoding(M->getName().data(), M->getName().size());
+    StringEncoding Bits = getStringEncoding(M->getSourceFileName().data(),
+                                            M->getSourceFileName().size());
     BitCodeAbbrevOp AbbrevOpToUse = BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 8);
     if (Bits == SE_Char6)
       AbbrevOpToUse = BitCodeAbbrevOp(BitCodeAbbrevOp::Char6);




More information about the llvm-commits mailing list