[lldb] [llvm] Add support for using foreign type units in .debug_names. (PR #87740)

Alex Langford via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 5 14:24:18 PDT 2024


================
@@ -60,8 +60,10 @@ void ManualDWARFIndex::Index() {
   }
   if (dwp_info && dwp_info->ContainsTypeUnits()) {
     for (size_t U = 0; U < dwp_info->GetNumUnits(); ++U) {
-      if (auto *tu = llvm::dyn_cast<DWARFTypeUnit>(dwp_info->GetUnitAtIndex(U)))
-        units_to_index.push_back(tu);
+      if (auto *tu = llvm::dyn_cast<DWARFTypeUnit>(dwp_info->GetUnitAtIndex(U))) {
+        if (m_type_sigs_to_avoid.count(tu->GetTypeHash()) == 0)
----------------
bulbazord wrote:

Suggestion: It might be clearer to use `contains` directly instead of `count(...) == 0`

https://github.com/llvm/llvm-project/pull/87740


More information about the llvm-commits mailing list