[llvm] [Support] Accept -no-<name> to negate cl::opt<bool> (PR #224978)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 06:38:41 PDT 2026


================
@@ -221,13 +221,15 @@ literally into the content of the string variable... we obviously cannot do that
 in the boolean case, however, so we must use a smarter parser.  In the case of
 the boolean parser, it allows no options (in which case it assigns the value of
 true to the variable), or it allows the values "`true`" or "`false`" to be
-specified, allowing any of the following inputs:
+specified; a boolean option can also be negated with a `no-` prefix, allowing
+any of the following inputs:
----------------
aengelke wrote:

Docs should specify behavior if a conflicting no-f is defined.

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


More information about the llvm-commits mailing list