[all-commits] [llvm/llvm-project] 11ee69: [clang][tooling] Accept Clang invocations with mul...
Jan Svoboda via All-commits
all-commits at lists.llvm.org
Tue Jul 27 01:48:11 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 11ee699b3c812ebe56ce5d3b14ab7ef16c1e8495
https://github.com/llvm/llvm-project/commit/11ee699b3c812ebe56ce5d3b14ab7ef16c1e8495
Author: Jan Svoboda <jan_svoboda at apple.com>
Date: 2021-07-27 (Tue, 27 Jul 2021)
Changed paths:
M clang/include/clang/Tooling/Tooling.h
M clang/lib/Tooling/Tooling.cpp
R clang/test/Tooling/clang-check-offload.cpp
M clang/unittests/Tooling/ToolingTest.cpp
Log Message:
-----------
[clang][tooling] Accept Clang invocations with multiple jobs
When `-fno-integrated-as` is passed to the Clang driver (or set by default by a specific toolchain), it will construct an assembler job in addition to the cc1 job. Similarly, the `-fembed-bitcode` driver flag will create additional cc1 job that reads LLVM IR file.
The Clang tooling library only cares about the job that reads a source file. Instead of relying on the fact that the client injected `-fsyntax-only` to the driver invocation to get a single `-cc1` invocation that reads the source file, this patch filters out such jobs from `Compilation` automatically and ignores the rest.
This fixes a test failure in `ClangScanDeps/headerwithname.cpp` and `ClangScanDeps/headerwithnamefollowedbyinclude.cpp` on AIX reported here: https://reviews.llvm.org/D103461#2841918 and `clang-scan-deps` failures with `-fembed-bitcode`.
Depends on D106788.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D105695
More information about the All-commits
mailing list