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

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 00:56:46 PDT 2026


MaskRay wrote:

> Aside: It would be nice if registering a bool option `x` and another option `no-x` would result in an error -- or is there a use case where one would want to define both and handle them differently instead of using boolOrUnset? Or maybe eventually forbid options starting with no altogether?

Agreed that we should reject this combination. However, a few tools define both `-no-flag` and `-flag`. This PR has migrated llvm-xray.

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


More information about the llvm-commits mailing list