Skip to content

Commit 4ea5c60

Browse files
authored
[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: swiftlang#7885
1 parent f7cb1af commit 4ea5c60

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lldb/include/lldb/Symbol/Type.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ class TypeQuery {
247247
/// match.
248248
void AddLanguage(lldb::LanguageType language);
249249

250+
/// Set the list of languages that should produce a match to only the ones
251+
/// specified in \ref languages.
252+
void SetLanguages(LanguageSet languages);
253+
250254
/// Check if the language matches any languages that have been added to this
251255
/// match object.
252256
///

lldb/source/Symbol/Type.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ void TypeQuery::AddLanguage(LanguageType language) {
145145
m_languages->Insert(language);
146146
}
147147

148+
void TypeQuery::SetLanguages(LanguageSet languages) {
149+
m_languages = std::move(languages);
150+
}
151+
148152
bool TypeQuery::ContextMatches(
149153
llvm::ArrayRef<CompilerContext> context_chain) const {
150154
if (GetExactMatch() || context_chain.size() == m_context.size())

0 commit comments

Comments
 (0)