Author: Michael Buch Date: 2024-01-09T16:02:56Z New Revision: 4ea5c603b4c4db36b8ee7e04adf96416f4d996dc
URL: https://github.com/llvm/llvm-project/commit/4ea5c603b4c4db36b8ee7e04adf96416f4d996dc DIFF: https://github.com/llvm/llvm-project/commit/4ea5c603b4c4db36b8ee7e04adf96416f4d996dc.diff LOG: [lldb][Type] Add TypeQuery::SetLanguages API (#75926) This is required for users of `TypeQuery` that limit the set of languages of the query using APIs such as `GetSupportedLanguagesForTypes` or `GetSupportedLanguagesForExpressions`. Example usage: https://github.com/apple/llvm-project/pull/7885 Added: Modified: lldb/include/lldb/Symbol/Type.h lldb/source/Symbol/Type.cpp Removed: ################################################################################ diff --git a/lldb/include/lldb/Symbol/Type.h b/lldb/include/lldb/Symbol/Type.h index 307be6c55e0161..acd1a769f13cd6 100644 --- a/lldb/include/lldb/Symbol/Type.h +++ b/lldb/include/lldb/Symbol/Type.h @@ -247,6 +247,10 @@ class TypeQuery { /// match. void AddLanguage(lldb::LanguageType language); + /// Set the list of languages that should produce a match to only the ones + /// specified in \ref languages. + void SetLanguages(LanguageSet languages); + /// Check if the language matches any languages that have been added to this /// match object. /// diff --git a/lldb/source/Symbol/Type.cpp b/lldb/source/Symbol/Type.cpp index 293fe1b78f4a54..6069d066eaf66b 100644 --- a/lldb/source/Symbol/Type.cpp +++ b/lldb/source/Symbol/Type.cpp @@ -145,6 +145,10 @@ void TypeQuery::AddLanguage(LanguageType language) { m_languages->Insert(language); } +void TypeQuery::SetLanguages(LanguageSet languages) { + m_languages = std::move(languages); +} + bool TypeQuery::ContextMatches( llvm::ArrayRef<CompilerContext> context_chain) const { if (GetExactMatch() || context_chain.size() == m_context.size()) _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits