diff --git a/HelloWorld/HelloWorld.cpp b/HelloWorld/HelloWorld.cpp index 50fa94f..6c176f5 100644 --- a/HelloWorld/HelloWorld.cpp +++ b/HelloWorld/HelloWorld.cpp @@ -9,10 +9,7 @@ // there's no 'print' method here (every analysis pass should implement it). // // USAGE: -// 1. Legacy PM -// opt -enable-new-pm=0 -load libHelloWorld.dylib -legacy-hello-world -disable-output `\` -// -// 2. New PM +// New PM // opt -load-pass-plugin=libHelloWorld.dylib -passes="hello-world" `\` // -disable-output // @@ -53,18 +50,6 @@ struct HelloWorld : PassInfoMixin { // all functions with optnone. static bool isRequired() { return true; } }; - -// Legacy PM implementation -struct LegacyHelloWorld : public FunctionPass { - static char ID; - LegacyHelloWorld() : FunctionPass(ID) {} - // Main entry point - the name conveys what unit of IR this is to be run on. - bool runOnFunction(Function &F) override { - visitor(F); - // Doesn't modify the input unit of IR, hence 'false' - return false; - } -}; } // namespace //----------------------------------------------------------------------------- @@ -92,19 +77,3 @@ extern "C" LLVM_ATTRIBUTE_WEAK ::llvm::PassPluginLibraryInfo llvmGetPassPluginInfo() { return getHelloWorldPluginInfo(); } - -//----------------------------------------------------------------------------- -// Legacy PM Registration -//----------------------------------------------------------------------------- -// The address of this variable is used to uniquely identify the pass. The -// actual value doesn't matter. -char LegacyHelloWorld::ID = 0; - -// This is the core interface for pass plugins. It guarantees that 'opt' will -// recognize LegacyHelloWorld when added to the pass pipeline on the command -// line, i.e. via '--legacy-hello-world' -static RegisterPass - X("legacy-hello-world", "Hello World Pass", - true, // This pass doesn't modify the CFG => true - false // This pass is not a pure analysis pass => false - );