forked from OSchip/llvm-project
[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.
This commit is contained in:
parent
aae3c4f2b4
commit
98fa46f870
|
@ -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 @@ private:
|
|||
|
||||
std::unique_ptr<ASTConsumer>
|
||||
ExtractAPIAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
|
||||
return std::make_unique<ExtractAPIConsumer>(&CI.getASTContext());
|
||||
return std::make_unique<ExtractAPIConsumer>();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue