Skip to content

Commit 356d8a4

Browse files
committed
[NFC][lldb] Remove unused swift::ASTContext parameter from 2 functions
1 parent f8db055 commit 356d8a4

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4845,8 +4845,7 @@ CompilerType SwiftASTContext::GetAnyObjectType() {
48454845
return ToCompilerType({ast->getAnyObjectType()});
48464846
}
48474847

4848-
static CompilerType ValueDeclToType(swift::ValueDecl *decl,
4849-
swift::ASTContext *ast) {
4848+
static CompilerType ValueDeclToType(swift::ValueDecl *decl) {
48504849
if (decl) {
48514850
switch (decl->getKind()) {
48524851
case swift::DeclKind::TypeAlias: {
@@ -4875,15 +4874,14 @@ static CompilerType ValueDeclToType(swift::ValueDecl *decl,
48754874
return CompilerType();
48764875
}
48774876

4878-
static CompilerType DeclToType(swift::Decl *decl, swift::ASTContext *ast) {
4877+
static CompilerType DeclToType(swift::Decl *decl) {
48794878
if (swift::ValueDecl *value_decl =
48804879
swift::dyn_cast_or_null<swift::ValueDecl>(decl))
4881-
return ValueDeclToType(value_decl, ast);
4880+
return ValueDeclToType(value_decl);
48824881
return {};
48834882
}
48844883

4885-
static SwiftASTContext::TypeOrDecl DeclToTypeOrDecl(swift::ASTContext *ast,
4886-
swift::Decl *decl) {
4884+
static SwiftASTContext::TypeOrDecl DeclToTypeOrDecl(swift::Decl *decl) {
48874885
if (decl) {
48884886
switch (decl->getKind()) {
48894887
case swift::DeclKind::BuiltinTuple:
@@ -4963,12 +4961,10 @@ SwiftASTContext::FindContainedTypeOrDecl(llvm::StringRef name,
49634961

49644962
CompilerType container_type = container_type_or_decl.Apply<CompilerType>(
49654963
[](CompilerType type) -> CompilerType { return type; },
4966-
[this](swift::Decl *decl) -> CompilerType {
4967-
ThreadSafeASTContext ast_ctx = GetASTContext();
4968-
return DeclToType(decl, *ast_ctx);
4964+
[](swift::Decl *decl) -> CompilerType {
4965+
return DeclToType(decl);
49694966
});
49704967

4971-
ThreadSafeASTContext ast_ctx = GetASTContext();
49724968
if (!name.empty() &&
49734969
container_type.GetTypeSystem().isa_and_nonnull<TypeSystemSwift>()) {
49744970
swift::Type swift_type = GetSwiftTypeIgnoringErrors(container_type);
@@ -4983,7 +4979,7 @@ SwiftASTContext::FindContainedTypeOrDecl(llvm::StringRef name,
49834979
llvm::ArrayRef<swift::ValueDecl *> decls = nominal_decl->lookupDirect(
49844980
swift::DeclName(m_ast_context_ap->getIdentifier(name)));
49854981
for (auto *decl : decls)
4986-
results.emplace(DeclToTypeOrDecl(*ast_ctx, decl));
4982+
results.emplace(DeclToTypeOrDecl(decl));
49874983
}
49884984
return results.size() - size_before;
49894985
}
@@ -5060,7 +5056,6 @@ size_t SwiftASTContext::FindTypesOrDecls(const char *name,
50605056

50615057
size_t before = results.size();
50625058

5063-
ThreadSafeASTContext ast_ctx = GetASTContext();
50645059
if (name && name[0] && swift_module) {
50655060
llvm::SmallVector<swift::ValueDecl *, 4> value_decls;
50665061
swift::Identifier identifier(GetIdentifier(llvm::StringRef(name)));
@@ -5072,19 +5067,19 @@ size_t SwiftASTContext::FindTypesOrDecls(const char *name,
50725067
value_decls);
50735068
if (identifier.isOperator()) {
50745069
if (auto *op = swift_module->lookupPrefixOperator(identifier))
5075-
results.emplace(DeclToTypeOrDecl(*ast_ctx, op));
5070+
results.emplace(DeclToTypeOrDecl(op));
50765071

50775072
if (auto *op = swift_module->lookupInfixOperator(identifier).getSingle())
5078-
results.emplace(DeclToTypeOrDecl(*ast_ctx, op));
5073+
results.emplace(DeclToTypeOrDecl(op));
50795074

50805075
if (auto *op = swift_module->lookupPostfixOperator(identifier))
5081-
results.emplace(DeclToTypeOrDecl(*ast_ctx, op));
5076+
results.emplace(DeclToTypeOrDecl(op));
50825077
}
50835078
if (auto *pg = swift_module->lookupPrecedenceGroup(identifier).getSingle())
5084-
results.emplace(DeclToTypeOrDecl(*ast_ctx, pg));
5079+
results.emplace(DeclToTypeOrDecl(pg));
50855080

50865081
for (auto *decl : value_decls)
5087-
results.emplace(DeclToTypeOrDecl(*ast_ctx, decl));
5082+
results.emplace(DeclToTypeOrDecl(decl));
50885083
}
50895084

50905085
return results.size() - before;

0 commit comments

Comments
 (0)