[Lldb-commits] [lldb] [lldb] Don't repeat function lookups that only differ in language (PR #232926)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Sun Oct 18 06:24:13 PDT 2026


================
@@ -705,6 +705,18 @@ std::vector<Module::LookupInfo> Module::LookupInfo::MakeLookupInfos(
   for (LanguageType lang_type : lang_types) {
     Module::LookupInfo info(name, lookup_name_override, name_type_mask,
                             lang_type);
+    // The language of a lookup only matters for matching names that aren't
+    // full names, so a lookup of full names that only differs from an earlier
+    // one in its language would find the same functions again.
+    if (info.m_name_type_mask & eFunctionNameTypeFull &&
+        llvm::any_of(infos, [&info](const LookupInfo &other) {
+          return other.m_name == info.m_name &&
+                 other.m_lookup_name == info.m_lookup_name &&
+                 other.m_name_type_mask == info.m_name_type_mask &&
+                 other.m_match_name_after_lookup ==
+                     info.m_match_name_after_lookup;
+        }))
----------------
Michael137 wrote:

Could comparison be a member function of `LookupInfo`? E.g., `EqualsLanguageInsensitive` or something? Just worry we'll add a member to the class and forget to update this predicate.

Or an alternative would be to query the associated language plugin for whether it does parse the language name/has a name parser? Instead of comparing the lookup info objects?

Both are fine in my opinion. I guess the lookup info comparison allows us to skip processing the DIE even if the names did get parsed but ended up being the same anyway.

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


More information about the lldb-commits mailing list