//===- PrintFunctionNames.cpp ---------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // Example clang plugin which simply prints the names of all the top-level decls // in the input file. // //===----------------------------------------------------------------------===// #include "clang/Frontend/FrontendPluginRegistry.h" #include "clang/AST/AST.h" #include "clang/AST/ASTConsumer.h" #include "clang/AST/RecursiveASTVisitor.h" #include "clang/Frontend/CompilerInstance.h" #include "clang/Sema/Sema.h" #include "llvm/Support/raw_ostream.h" usingnamespaceclang; namespace { class PrintFunctionsConsumer : public ASTConsumer { … }; class PrintFunctionNamesAction : public PluginASTAction { … }; } static FrontendPluginRegistry::Add<PrintFunctionNamesAction> X("print-fns", "print function names");