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

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 4 17:03:08 PST 2018


Szelethus marked an inline comment as done.
Szelethus added a comment.

In D53280#1319503 <https://reviews.llvm.org/D53280#1319503>, @NoQ wrote:

> It's a flag that was removed but old soft doesn't know that it was removed, and it won't be fixed because it's old.


We could just add the flag back, and do nothing with it. We have already mentioned converting some frontend flags to analyzer configs, and removing some long enabled-by-default options while still leaving them in the code in some form or another for backward compatibility, so some carefully documented litter in `AnalyzerOptions` here and there wouldn't be the end of the world.



================
Comment at: lib/Driver/ToolChains/Clang.cpp:3307-3309
 void Clang::ConstructJob(Compilation &C, const JobAction &JA,
                          const InputInfo &Output, const InputInfoList &Inputs,
                          const ArgList &Args, const char *LinkingOutput) const {
----------------
NoQ wrote:
> Szelethus wrote:
> > Hmmm. If we just moved the `CmdArgs.push_back("-analyzer-config-compatibility-mode=true");` line to this function (which actually invokes `RenderAnalyzerOptions`), that would solve the issue, wouldn't it? Or somewhere in an even more general driver function.
> Yeah, but it's not going to be an `AnalyzeJobAction` in the problematic case. So you'd have to add this flag to every single clang invocation.
Aaaaand I bet that's something we can't do just like that.


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