This is an archive of the discontinued LLVM Phabricator instance.

Modules: Add -Rmodule-import
ClosedPublic

Authored by dexonsmith on Mar 3 2019, 9:52 PM.

Details

Summary

Add a remark for importing modules. Depending on whether this is a
direct import (into the TU being built by this compiler instance) or
transitive import (into an already-imported module), the diagnostic has
two forms:

importing module 'Foo' from 'path/to/Foo.pcm'
importing module 'Foo' into 'Bar' from 'path/to/Foo.pcm'

Also drop a redundant FileCheck invocation in Rmodule-build.m that was
using -Reverything, since the notes from -Rmodule-import were confusing
it.

Diff Detail

Event Timeline

dexonsmith created this revision.Mar 3 2019, 9:52 PM
dexonsmith marked an inline comment as done.Mar 3 2019, 11:29 PM
dexonsmith added inline comments.
clang/test/Modules/Rmodule-build.m
22–25

@bruno this looked redundant to me with the check above; can you confirm? (Now that we have -Rmodule-import, the FileCheck was failing...)

bruno accepted this revision.Mar 4 2019, 2:17 PM

Nice, note that a subset of this information can be achieved with -Wauto-import, but this is way more general and solid, since it will handles @imports and pragma imports too. LGTM with a minor nitpick, see comments.

clang/test/Modules/Inputs/Rmodule-import/B.h
1

Can you make one of the tests to use @import (or the pragma version) instead of #include?

clang/test/Modules/Rmodule-build.m
22–25

Yes, it should be fine.

This revision is now accepted and ready to land.Mar 4 2019, 2:17 PM
dexonsmith closed this revision.Mar 5 2019, 6:50 PM
dexonsmith marked 2 inline comments as done.

Committed in r355477.

clang/test/Modules/Inputs/Rmodule-import/B.h
1

I changed the import of D.