[PATCH] D53280: [analyzer] Emit an error for invalid -analyzer-config inputs

Umann Kristóf via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 30 13:26:29 PST 2018


Szelethus marked 6 inline comments as done.
Szelethus added inline comments.


================
Comment at: lib/Frontend/CompilerInvocation.cpp:367
 
-  parseAnalyzerConfigs(Opts, Diags);
+  if (Opts.ShouldEmitErrorsOnInvalidConfigValue)
+    parseAnalyzerConfigs(Opts, &Diags);
----------------
xazax.hun wrote:
> Do we actually need the branching here? It would be perfectly fine to always pass a pointer to `Diags` but sometimes just ignore it.
I'm not sure what would be the point of that, if we don't branch here, we'll have to somewhere else, and I'm not sure whether polluting `parseAnalyzerConfigs` with that would help on readability.

Or, if you mean that I should just check `Opts.ShouldEmitErrorsOnInvalidConfigValue` inside there, that could work, but I think it makes more sense that if we don't to validate configs, don't even supply the tool for it. Less room for error.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D53280/new/

https://reviews.llvm.org/D53280





More information about the cfe-commits mailing list