#include "clang/AST/AST.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendPluginRegistry.h"
#include "clang/Sema/Sema.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PassManager.h"
#include "llvm/Passes/OptimizationLevel.h"
#include "llvm/Passes/PassBuilder.h"
#include "llvm/Support/raw_ostream.h"
usingnamespaceclang;
namespace {
class PrintPass final : public llvm::AnalysisInfoMixin<PrintPass> { … };
void PrintCallback(llvm::PassBuilder &PB) { … }
class LLVMPrintFunctionsConsumer : public ASTConsumer { … };
class LLVMPrintFunctionNamesAction : public PluginASTAction { … };
}
static FrontendPluginRegistry::Add<LLVMPrintFunctionNamesAction>
X("llvm-print-fns", "print function names, llvm level");