Author: Zixu Wang Date: 2022-01-26T16:24:04-08:00 New Revision: 98fa46f870e402f225b60ab5d02487c36d79632b
URL: https://github.com/llvm/llvm-project/commit/98fa46f870e402f225b60ab5d02487c36d79632b DIFF: https://github.com/llvm/llvm-project/commit/98fa46f870e402f225b60ab5d02487c36d79632b.diff LOG: [FIX][clang] Fix unused private field in ExtractAPIVisitor Fix a build failure where an unused private field in ExtractAPIVisitor triggered a warning turned into error. Added: Modified: clang/lib/Frontend/ExtractAPIConsumer.cpp Removed: ################################################################################ diff --git a/clang/lib/Frontend/ExtractAPIConsumer.cpp b/clang/lib/Frontend/ExtractAPIConsumer.cpp index 92a0385c96cc0..cdf67f3c327aa 100644 --- a/clang/lib/Frontend/ExtractAPIConsumer.cpp +++ b/clang/lib/Frontend/ExtractAPIConsumer.cpp @@ -9,21 +9,14 @@ using namespace clang; namespace { class ExtractAPIVisitor : public RecursiveASTVisitor<ExtractAPIVisitor> { public: - explicit ExtractAPIVisitor(ASTContext *Context) : Context(Context) {} - bool VisitNamedDecl(NamedDecl *Decl) { llvm::outs() << Decl->getName() << "\n"; return true; } - -private: - ASTContext *Context; }; class ExtractAPIConsumer : public ASTConsumer { public: - explicit ExtractAPIConsumer(ASTContext *Context) : Visitor(Context) {} - void HandleTranslationUnit(ASTContext &Context) override { Visitor.TraverseDecl(Context.getTranslationUnitDecl()); } @@ -35,5 +28,5 @@ class ExtractAPIConsumer : public ASTConsumer { std::unique_ptr<ASTConsumer> ExtractAPIAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { - return std::make_unique<ExtractAPIConsumer>(&CI.getASTContext()); + return std::make_unique<ExtractAPIConsumer>(); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits