This is an archive of the discontinued LLVM Phabricator instance.

Make `-fmodule-file=<name>=<path>` apply to .pcm file compilations
Needs ReviewPublic

Authored by andrewjcg on Nov 13 2019, 9:08 PM.

Details

Reviewers
dblaikie
rsmith
Summary

When precompiling a header module, -fmodule-file=name>=<path> flags
can be used to provide an updated path to a module, which allows modules
to be moved from the location they were compiled against.

This diff makes these flags also apply to when compiling a .pcm file
into a .o.

Event Timeline

andrewjcg created this revision.Nov 13 2019, 9:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 13 2019, 9:08 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
andrewjcg added a subscriber: modocache.

Looks reasonable to me, but I don't know a great deal about the PrebuiltModuleFiles & so I'd like @rsmith to at least glance at/approve this.

This seems like a outright improvement, but as mentioned above it would be nice to get @rsmith's take on it since I'm not an expert. Two nitpicks, though:

  1. Could you please run clang-format on the lines you added/modified?
  2. Could you apply these changes on top of the llvm-project monorepo? You can do so by using the "download raw diff" link on this page, and then running git apply --directory=clang -p 0 D70219.diff from within the monorepo. I tried just now to confirm the tests pass with this change (they do!), and that command was able to apply the patch cleanly for me.
lib/Frontend/FrontendAction.cpp
568 ↗(On Diff #229226)

For example I think this line would change if clang-format were to be run on it.

andrewjcg updated this revision to Diff 232190.Dec 4 2019, 12:31 PM

rebase onto monorepo and clang-format