[clang] [llvm] [OptBisect][IR] Adding a new OptPassGate for disabling passes via name (PR #145059)

Mircea Trofin via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 23 10:26:31 PDT 2025


================
@@ -51,10 +51,59 @@ bool OptBisect::shouldRunPass(const StringRef PassName,
   int CurBisectNum = ++LastBisectNum;
   bool ShouldRun = (BisectLimit == -1 || CurBisectNum <= BisectLimit);
   if (OptBisectVerbose)
-    printPassMessage(PassName, CurBisectNum, IRDescription, ShouldRun);
+    printBisectPassMessage(PassName, CurBisectNum, IRDescription, ShouldRun);
   return ShouldRun;
 }
 
 const int OptBisect::Disabled;
 
-OptPassGate &llvm::getGlobalPassGate() { return getOptBisector(); }
+static OptDisable &getOptDisabler() {
+  static OptDisable OptDisabler;
+  return OptDisabler;
+}
+
+static cl::opt<std::string> OptDisablePass(
----------------
mtrofin wrote:

I think you can use `cl::list<std::string>`

https://github.com/llvm/llvm-project/pull/145059


More information about the cfe-commits mailing list