HomePhabricator

[clang][tooling] Accept Clang invocations with multiple jobs

Authored by jansvoboda11 on Jul 26 2021, 4:40 AM.

Description

[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

Details

Committed
jansvoboda11Jul 27 2021, 1:47 AM
Reviewer
dexonsmith
Differential Revision
D105695: [clang][tooling] Accept Clang invocations with multiple jobs
Parents
rG2e27c4e1f187: [AArch64][SME] Add zero instruction
Branches
Unknown
Tags
Unknown