when dealing with -gmodules debug info.
This fixes the bot failures on Darwin.
A recent clang change (presumably https://reviews.llvm.org/D104291)
introduced a bug where .pcm files would identify themselves as
DW_LANG_C_plus_plus, but the .o that references them would identify as
DW_LANG_C_plus_plus_14. While that bug needs to be fixed, too, it
shows that the current strict comparison also isn't meaningful.
rdar://
79423225
// The type in the Clang module must have the same language as the current CU.
LanguageSet languages;
- languages.Insert(SymbolFileDWARF::GetLanguage(*die.GetCU()));
+ languages.Insert(SymbolFileDWARF::GetLanguageFamily(*die.GetCU()));
llvm::DenseSet<SymbolFile *> searched_symbol_files;
clang_module_sp->GetSymbolFile()->FindTypes(decl_context, languages,
searched_symbol_files, pcm_types);
return;
m_index->GetTypes(name, [&](DWARFDIE die) {
- if (!languages[GetLanguage(*die.GetCU())])
+ if (!languages[GetLanguageFamily(*die.GetCU())])
return true;
llvm::SmallVector<CompilerContext, 4> die_context;
LanguageType SymbolFileDWARF::GetLanguage(DWARFUnit &unit) {
return LanguageTypeFromDWARF(unit.GetDWARFLanguageType());
}
+
+LanguageType SymbolFileDWARF::GetLanguageFamily(DWARFUnit &unit) {
+ auto lang = (llvm::dwarf::SourceLanguage)unit.GetDWARFLanguageType();
+ if (llvm::dwarf::isCPlusPlus(lang))
+ lang = DW_LANG_C_plus_plus;
+ return LanguageTypeFromDWARF(lang);
+}
static lldb::LanguageType LanguageTypeFromDWARF(uint64_t val);
static lldb::LanguageType GetLanguage(DWARFUnit &unit);
+ /// Same as GetLanguage() but reports all C++ versions as C++ (no version).
+ static lldb::LanguageType GetLanguageFamily(DWARFUnit &unit);
protected:
typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb_private::Type *>