Also make the output of -emit-ast end up where /o points.
The same with .plist files from the static analyzer.
These are changes needed to make it possible to do CTU static
analysing work with clang-cl.
Differential D128409
[clang-cl] Add -emit-ast to clang-cl driver thieta on Jun 23 2022, 1:42 AM. Authored by
Details
Also make the output of -emit-ast end up where /o points. These are changes needed to make it possible to do CTU static
Diff Detail
Event Timeline
Comment Actions CTU is cross translation unit. In this case the clang-static-analyzer can do analysis over several files - see the official docs that recommend that you build the .ast files with -emit-ast:
I can definitely add tests. What do you think needs a test here? that -emit-ast works the same with clang and clang-cl? Do we generally test the same arguments for all drivers even if they are expected to do the same thing?
Comment Actions Thanks! I wasn't aware of this.
I think we should just check that clang-cl accepts the flag and passes the right thing to the -cc1 invocation (including that we get the output file name right).
Comment Actions Added tests and moved the check for TY_Plist and TY_AST to it's own if statement block Comment Actions It feels kind of weird to use the /Fo option for this that's for object files, but if that makes using the static analyzer more convenient that's okay I suppose.
Comment Actions Fixed the test issue. Regarding /Fo bit - if you want I can change it to only handle /o in this if statement. I don't mind either way.
Comment Actions
Just doing /o seems better. Thanks.
|
Whops. My editor strikes again and removes a trailing space. Let me know if I should edit this out of this commit.