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 @@ -473,7 +473,7 @@ } void PrintIRInstrumentation::printBeforePass(StringRef PassID, Any IR) { - if (PassID.startswith("PassManager<") || PassID.contains("PassAdaptor<")) + if (isIgnored(PassID)) return; // Saving Module for AfterPassInvalidated operations. @@ -492,7 +492,7 @@ } void PrintIRInstrumentation::printAfterPass(StringRef PassID, Any IR) { - if (PassID.startswith("PassManager<") || PassID.contains("PassAdaptor<")) + if (isIgnored(PassID)) return; if (!llvm::shouldPrintAfterPass(PassID)) @@ -509,7 +509,7 @@ if (!StoreModuleDesc || !llvm::shouldPrintAfterPass(PassID)) return; - if (PassID.startswith("PassManager<") || PassID.contains("PassAdaptor<")) + if (isIgnored(PassID)) return; const Module *M; @@ -599,13 +599,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(