diff --git a/llvm/include/llvm/IR/LegacyPassManagers.h b/llvm/include/llvm/IR/LegacyPassManagers.h index d25bcafc9cc05..b1a2148f08894 100644 --- a/llvm/include/llvm/IR/LegacyPassManagers.h +++ b/llvm/include/llvm/IR/LegacyPassManagers.h @@ -461,7 +461,7 @@ class LLVM_ABI FPPassManager : public ModulePass, public PMDataManager { /// run - Execute all of the passes scheduled for execution. Keep track of /// whether any of the passes modifies the module, and if so, return true. - bool runOnFunction(Function &F); + virtual bool runOnFunction(Function &F); bool runOnModule(Module &M) override; /// cleanup - After running all passes, clean up pass manager cache. @@ -496,7 +496,7 @@ class LLVM_ABI FPPassManager : public ModulePass, public PMDataManager { // Print passes managed by this manager void dumpPassStructure(unsigned Offset) override; - StringRef getPassName() const override { return "Function Pass Manager"; } + StringRef getPassName() const override { return "FunctionPass Manager"; } FunctionPass *getContainedPass(unsigned N) { assert ( N < PassVector.size() && "Pass number out of range!"); @@ -507,6 +507,10 @@ class LLVM_ABI FPPassManager : public ModulePass, public PMDataManager { PassManagerType getPassManagerType() const override { return PMT_FunctionPassManager; } + +protected: + // So subclasses can pass their own ID. + explicit FPPassManager(char &ID) : ModulePass(ID) {} }; } diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp index 47a828842b481..00b8c68b28a92 100644 --- a/llvm/lib/IR/LegacyPassManager.cpp +++ b/llvm/lib/IR/LegacyPassManager.cpp @@ -1342,7 +1342,7 @@ void FPPassManager::cleanup() { char FPPassManager::ID = 0; /// Print passes managed by this manager void FPPassManager::dumpPassStructure(unsigned Offset) { - dbgs().indent(Offset*2) << "FunctionPass Manager\n"; + dbgs().indent(Offset * 2) << getPassName() << '\n'; for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { FunctionPass *FP = getContainedPass(Index); FP->dumpPassStructure(Offset + 1); diff --git a/llvm/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll b/llvm/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll index 08c314e538734..1c2688f90bb3f 100644 --- a/llvm/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll +++ b/llvm/test/CodeGen/AArch64/arm64-opt-remarks-lazy-bfi.ll @@ -31,7 +31,7 @@ ; please adjust accordingly.) ; HOTNESS: Freeing Pass 'Machine Outliner' -; HOTNESS-NEXT: Executing Pass 'Function Pass Manager' +; HOTNESS-NEXT: Executing Pass 'FunctionPass Manager' ; HOTNESS-NEXT: Executing Pass 'Verify generated machine code' on Function 'empty_func'... ; HOTNESS-NEXT: Freeing Pass 'Verify generated machine code' on Function 'empty_func'... ; HOTNESS-NEXT: Executing Pass 'AArch64 sls hardening pass' on Function 'empty_func'... @@ -76,7 +76,7 @@ ; NO_HOTNESS: Freeing Pass 'Machine Outliner' -; NO_HOTNESS-NEXT: Executing Pass 'Function Pass Manager' +; NO_HOTNESS-NEXT: Executing Pass 'FunctionPass Manager' ; NO_HOTNESS-NEXT: Executing Pass 'Verify generated machine code' on Function 'empty_func'... ; NO_HOTNESS-NEXT: Freeing Pass 'Verify generated machine code' on Function 'empty_func'... ; NO_HOTNESS-NEXT: Executing Pass 'AArch64 sls hardening pass' on Function 'empty_func'...