diff --git a/llvm/lib/Passes/StandardInstrumentations.cpp b/llvm/lib/Passes/StandardInstrumentations.cpp --- a/llvm/lib/Passes/StandardInstrumentations.cpp +++ b/llvm/lib/Passes/StandardInstrumentations.cpp @@ -474,7 +474,7 @@ } void PrintIRInstrumentation::printBeforePass(StringRef PassID, Any IR) { - if (PassID.startswith("PassManager<") || PassID.contains("PassAdaptor<")) + if (isIgnored(PassID)) return; // Saving Module for AfterPassInvalidated operations. @@ -493,7 +493,7 @@ } void PrintIRInstrumentation::printAfterPass(StringRef PassID, Any IR) { - if (PassID.startswith("PassManager<") || PassID.contains("PassAdaptor<")) + if (isIgnored(PassID)) return; if (!shouldPrintAfterPass(PassID)) @@ -511,7 +511,7 @@ if (!StoreModuleDesc || !shouldPrintAfterPass(PassName)) return; - if (PassID.startswith("PassManager<") || PassID.contains("PassAdaptor<")) + if (isIgnored(PassID)) return; const Module *M; @@ -627,13 +627,9 @@ if (!isEnabled()) return; - std::vector SpecialPasses = {"PassManager", "PassAdaptor"}; - - PIC.registerShouldRunOptionalPassCallback( - [this, SpecialPasses](StringRef PassID, Any IR) { - return isSpecialPass(PassID, SpecialPasses) || - checkPass(PassID, getBisectDescription(IR)); - }); + PIC.registerShouldRunOptionalPassCallback([this](StringRef PassID, Any IR) { + return isIgnored(PassID) || checkPass(PassID, getBisectDescription(IR)); + }); } void PrintPassInstrumentation::registerCallbacks(