HighCommander4 wrote:

> unfortunately, LLVM's command-line argument framework doesn't allow us to 
> distinguish between "the option's value is `IWYU` because the flag 
> `--header-insertion=iwyu` appeared in the command line" and "the option's 
> value is `IWYU` because no `--header-insertion` flag appeared in the command 
> line and `IWYU` is the default"

It looks like I was mistaken about this: there is an 
[`Option::getNumOccurrences()`](https://searchfox.org/llvm/rev/3d91a71223801bb73ab3e4ff8ab3f883639ed79f/llvm/include/llvm/Support/CommandLine.h#399)
 method that allows us to distinguish between these two cases.

So, if you'd like, we could revisit this and make the behaviour more consistent 
(e.g. so that `--header-insertion` always overrides `HeaderInsertion` if it was 
actually passed, or vice versa).

https://github.com/llvm/llvm-project/pull/128503
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to