[PATCH] D53274: [analyzer][NFC] Fix inconsistencies in AnalyzerOptions

Umann Kristóf via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 15 11:28:47 PDT 2018


Szelethus added a comment.

In https://reviews.llvm.org/D53274#1265625, @george.karpenkov wrote:

> I'm not sure why you could get away with removing those llvm_unreachable cases?


Because I got a warning for using `default` when every enum value was handled in the switch. Since whether the flag is set or not can be retrieved via `llvm::Optional::hasValue()`, I removed the `.*NotSet` flags. The future maintainer who adds a new value will get a warning for not handling it anyways.

In https://reviews.llvm.org/D53274#1265618, @george.karpenkov wrote:

> > The main motivation behind here is to emit warnings if an invalid
>
> I'm totally with you here, but IIRC (@NoQ might want to correct me here),
>  the design decision was made specifically to ignore incorrect options, so that e.g. old versions of Xcode used with old projects would still work.


I intend to emit a warning, but go on with the analysis. That's fair I believe?


https://reviews.llvm.org/D53274





More information about the cfe-commits mailing list