[clang] Allow clang-check to customize analyzer output file or dir name
authorElla Ma <alansnape3058@gmail.com>
Mon, 15 Nov 2021 15:47:39 +0000 (16:47 +0100)
committerKirill Bobyrev <kbobyrev@google.com>
Mon, 15 Nov 2021 15:49:41 +0000 (16:49 +0100)
commitda168dd875bf0392e8e88834009d776bfbaae376
tree5a5c1d13a15c069f742764c1f02e6f4616b2ddca
parent677df8c709d8c3913c6c1d03a30c4485e22419dc
[clang] Allow clang-check to customize analyzer output file or dir name

Required by https://stackoverflow.com/questions/58073606

As the output argument is stripped out in the clang-check tool, it seems impossible for clang-check users to customize the output file name, even with -extra-args and -extra-arg-before.

This patch adds the -analyzer-output-path argument to allow users to adjust the output name. And if the argument is not set or the analyzer is not enabled, the original strip output adjuster will remove the output arguments.

Differential Revision: https://reviews.llvm.org/D97265
clang/test/Tooling/clang-check-set-analyzer-output-path.cpp [new file with mode: 0644]
clang/tools/clang-check/ClangCheck.cpp