From 56dc4e842dd11baf7d245fd00c9bf930f3fcb772 Mon Sep 17 00:00:00 2001 From: Allan Shortlidge Date: Tue, 14 Jan 2025 11:33:16 -0800 Subject: [PATCH 1/2] AST: Resolve an unused variable warning in DeclContext.cpp. --- lib/AST/DeclContext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/AST/DeclContext.cpp b/lib/AST/DeclContext.cpp index f006846d2148c..d2d651ccbdb2b 100644 --- a/lib/AST/DeclContext.cpp +++ b/lib/AST/DeclContext.cpp @@ -1195,7 +1195,7 @@ void IterableDeclContext::checkDeserializeMemberErrorInPackage(ModuleDecl *acces // This needs to be set to force load all members if not done already. setHasLazyMembers(true); // Calling getMembers actually loads the members. - auto members = getMembers(); + (void)getMembers(); assert(!hasLazyMembers()); assert(didDeserializeMembers()); } From 5d72e69b2e48cc23542539d8dc205e4e52425f12 Mon Sep 17 00:00:00 2001 From: Allan Shortlidge Date: Tue, 14 Jan 2025 11:33:48 -0800 Subject: [PATCH 2/2] AST: Resolve an unused field warning in ClangImporter.cpp. --- lib/ClangImporter/ClangImporter.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/ClangImporter/ClangImporter.cpp b/lib/ClangImporter/ClangImporter.cpp index 876c78c32f586..a1355d880a5f7 100644 --- a/lib/ClangImporter/ClangImporter.cpp +++ b/lib/ClangImporter/ClangImporter.cpp @@ -188,18 +188,16 @@ namespace { }; class ParsingAction : public clang::ASTFrontendAction { - ASTContext &Ctx; ClangImporter &Importer; ClangImporter::Implementation &Impl; const ClangImporterOptions &ImporterOpts; std::string SwiftPCHHash; public: - explicit ParsingAction(ASTContext &ctx, - ClangImporter &importer, + explicit ParsingAction(ClangImporter &importer, ClangImporter::Implementation &impl, const ClangImporterOptions &importerOpts, std::string swiftPCHHash) - : Ctx(ctx), Importer(importer), Impl(impl), ImporterOpts(importerOpts), + : Importer(importer), Impl(impl), ImporterOpts(importerOpts), SwiftPCHHash(swiftPCHHash) {} std::unique_ptr CreateASTConsumer(clang::CompilerInstance &CI, StringRef InFile) override { @@ -1477,7 +1475,7 @@ ClangImporter::create(ASTContext &ctx, } // Create the associated action. - importer->Impl.Action.reset(new ParsingAction(ctx, *importer, + importer->Impl.Action.reset(new ParsingAction(*importer, importer->Impl, importerOpts, swiftPCHHash));