#include "llvm/IR/Function.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/Pass.h"
#include "llvm/Passes/PassBuilder.h"
#include "llvm/Passes/PassPlugin.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/raw_ostream.h"
usingnamespacellvm;
static cl::opt<bool> Wave("wave-goodbye", cl::init(false),
cl::desc("wave good bye"));
namespace {
bool runBye(Function &F) { … }
struct LegacyBye : public FunctionPass { … };
struct Bye : PassInfoMixin<Bye> { … };
}
char LegacyBye::ID = …;
static RegisterPass<LegacyBye> X("goodbye", "Good Bye World Pass",
false ,
false );
llvm::PassPluginLibraryInfo getByePluginInfo() { … }
#ifndef LLVM_BYE_LINK_INTO_TOOLS
extern "C" LLVM_ATTRIBUTE_WEAK ::llvm::PassPluginLibraryInfo
llvmGetPassPluginInfo() { … }
#endif