[PATCH] D55823: [analyzer] Fix backward compatibility issue after D53280 'Emit an error for invalid -analyzer-config inputs'

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 19 11:12:00 PST 2018


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


================
Comment at: lib/Driver/ToolChains/Clang.cpp:3694
 
+  {
+    auto AnalyzerConfigArg =
----------------
When I dump `Args` for the following invocation, I get this:

`clang -c dummie.cpp -Xclang -analyzer-config -Xclang blahblah=haha`
```
* < Opt:<FlagClass Prefixes:["-"] Name:"c" Group:<GroupClass Name:"<action group>">
>
 Index:0 Values: []>
* < Opt:<InputClass Prefixes:[] Name:"<input>">
 Index:1 Values: ['test/Analysis/cxx-uninitialized-object.cpp']>
* < Opt:<SeparateClass Prefixes:["-"] Name:"Xclang" Group:<GroupClass Name:"<CompileOnly group>">
>
 Index:2 Values: ['-analyzer-config']>
* < Opt:<SeparateClass Prefixes:["-"] Name:"Xclang" Group:<GroupClass Name:"<CompileOnly group>">
>
 Index:4 Values: ['blahblah=haha']>

```

so there should be a way to retrieve it. For `Args.getArgString(/*index*/3)` it also prints `"-analyzer-config"` -- but I'm still looking for a "proper" way.


Repository:
  rC Clang

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

https://reviews.llvm.org/D55823





More information about the cfe-commits mailing list