This is an archive of the discontinued LLVM Phabricator instance.

[clang][deps] Support object files
ClosedPublic

Authored by jansvoboda11 on Jun 2 2021, 5:55 AM.

Details

Summary

When a project uses PCH with explicit modules, the build will look like this:

  1. scan PCH dependencies
  2. explicitly build PCH
  3. scan TU dependencies
  4. explicitly build TU

Step 2 produces an object file for the PCH, which the dependency scanner needs to read in step 3. This patch adds support for this.

The clang-scan-deps invocation in the attached test would fail without this change.

Depends on D103516.

Diff Detail

Event Timeline

jansvoboda11 created this revision.Jun 2 2021, 5:55 AM
jansvoboda11 requested review of this revision.Jun 2 2021, 5:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2021, 5:55 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
Bigcheese accepted this revision.Jun 3 2021, 9:14 AM

lgtm

clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
161–162

This should have a comment that we don't actually write out any PCHs, but this is still needed due to how things are currently implemented.

This revision is now accepted and ready to land.Jun 3 2021, 9:14 AM
jansvoboda11 edited the summary of this revision. (Show Details)Jun 4 2021, 5:47 AM
This revision was landed with ongoing or failed builds.Jun 4 2021, 5:58 AM
This revision was automatically updated to reflect the committed changes.