This is an archive of the discontinued LLVM Phabricator instance.

[clang][deps] Add argument for customizing PCM paths
ClosedPublic

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

Details

Summary

Dependency scanning currently performs an implicit build. When testing that Clang can build modules with the command-lines generated by clang-scan-deps, the actual compilation would overwrite artifacts created during the scan, which makes debugging harder than it should be and can lead to errors in multi-step builds.

To prevent this, this patch adds new flag to clang-scan-deps that allows developers to customize the directory to use when generating module map paths, instead of always using the module cache. Moreover, the explicit context hash in now part of the PCM path, which will be useful in D102488, where the context hash can change due to command-line pruning.

Diff Detail

Event Timeline

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

lgtm with a few minor changes.

clang/tools/clang-scan-deps/ClangScanDeps.cpp
168–169

This was a bit confusing at first. I think it would be better to say that the paths that it returns are using this directory as a base. clang-scan-deps doesn't actually put files in here itself, it just returns paths that use it.

419

This doesn't need to use the IndexedModuleID. It can just use ModuleID.

This revision is now accepted and ready to land.Jun 3 2021, 8:50 AM
jansvoboda11 retitled this revision from [clang][deps] Customize PCM path via -build-dir argument to [clang][deps] Add argument for customizing PCM paths.Jun 4 2021, 5:03 AM
jansvoboda11 edited the summary of this revision. (Show Details)
This revision was landed with ongoing or failed builds.Jun 4 2021, 5:45 AM
This revision was automatically updated to reflect the committed changes.