================
@@ -153,19 +127,89 @@ void TypeQuery::SetLanguages(LanguageSet languages) {
bool TypeQuery::ContextMatches(
llvm::ArrayRef<CompilerContext> context_chain) const {
- if (GetExactMatch() || context_chain.size() == m_context.size())
- return ::contextMatches(context_chain, m_context);
-
- // We don't have an exact match, we need to bottom m_context.size() items to
- // match for a successful lookup.
- if (context_chain.size() < m_context.size())
- return false; // Not enough items in context_chain to allow for a match.
-
- size_t compare_count = context_chain.size() - m_context.size();
- return ::contextMatches(
- llvm::ArrayRef<CompilerContext>(context_chain.data() + compare_count,
- m_context.size()),
- m_context);
+ auto ctx = context_chain.rbegin(), ctx_end = context_chain.rend();
+ for (auto pat = m_context.rbegin(), pat_end = m_context.rend();
+ pat != pat_end;) {
+
+ // Handle AnyModule matches. These are tricky as they can match any number
----------------
Michael137 wrote:
Actually just grepped for this in the `apple/llvm-project` fork and looks like
we're using it in the Swift plugin:
https://github.com/swiftlang/llvm-project/blob/ee8bc8b8d30eb99807adbcd3c1f044e00af66cdd/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp#L219-L225
@adrian-prantl @augusto2112 @kastiglione could you elaborate on the usage of
this lookup-type here and why it's needed? An unfortunate side-effect of only
having it be exercised in the Swift plugin is that we need to support this
non-trivial matching algorithm while having the tests in a different repo.
That being said, I don't want to block this PR on this question, since the
change itself LGTM
https://github.com/llvm/llvm-project/pull/99305
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits