From f7951f47fa36e7bef071c26d33b0382a83f90242 Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Tue, 3 Jan 2017 23:19:29 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290915 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bitcode/Reader/MetadataLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Bitcode/Reader/MetadataLoader.cpp b/lib/Bitcode/Reader/MetadataLoader.cpp index cd08268d47b..5da421a79b7 100644 --- a/lib/Bitcode/Reader/MetadataLoader.cpp +++ b/lib/Bitcode/Reader/MetadataLoader.cpp @@ -749,7 +749,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( // 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 ||