dsymutil: Fix the condition to distinguish module imports form definitions.
[oota-llvm.git] / tools / dsymutil / DwarfLinker.cpp
index 1aa15c5fb679c724d03e33755c035bf5d45710b6..8489189cc16a95954c19ea362a4ad64cc8f8db94 100644 (file)
@@ -1780,7 +1780,7 @@ static bool analyzeContextInfo(const DWARFDebugInfoEntryMinimal *DIE,
   //   definitions match)."
   //
   // We treat non-C++ modules like namespaces for this reason.
-  if (DIE->getTag() == dwarf::DW_TAG_module &&
+  if (DIE->getTag() == dwarf::DW_TAG_module && ParentIdx == 0 &&
       DIE->getAttributeValueAsString(&CU.getOrigUnit(), dwarf::DW_AT_name,
                                      "") != CU.getClangModuleName()) {
     InImportedModule = true;