[llvm] r290915 - [ThinLTO] Import type as decl only when non-null Identifier

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 3 15:19:30 PST 2017


Author: tejohnson
Date: Tue Jan  3 17:19:29 2017
New Revision: 290915

URL: http://llvm.org/viewvc/llvm-project?rev=290915&view=rev
Log:
[ThinLTO] Import type as decl only when non-null Identifier

As per post-commit review for r289993 (D27775), we can only safely
import a type as a decl if it has an Identifier, as the Name alone
is not enough to be unique across modules.

Modified:
    llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp

Modified: llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp?rev=290915&r1=290914&r2=290915&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp Tue Jan  3 17:19:29 2017
@@ -749,7 +749,7 @@ Error MetadataLoader::MetadataLoaderImpl
     // handles the case where this is type ODRed with a definition needed
     // by the importing module, in which case the existing definition is
     // used.
-    if (IsImporting && !ImportFullTypeDefinitions &&
+    if (IsImporting && !ImportFullTypeDefinitions && Identifier &&
         (Tag == dwarf::DW_TAG_enumeration_type ||
          Tag == dwarf::DW_TAG_class_type ||
          Tag == dwarf::DW_TAG_structure_type ||




More information about the llvm-commits mailing list