Commit Graph

4 Commits

Author SHA1 Message Date
Richard Smith c51c38b4ec Add pragma to perform module import and use it in -E output.
Many of our supported configurations support modules but do not have any
first-class syntax to perform a module import. This leaves us with a problem:
there is no way to represent the expansion of a #include that imports a module
in the -E output for such languages. (We don't want to just leave it as a
#include because that requires the consumer of the preprocessed source to have
the same file system layout and include paths as the creator.)

This patch adds a new pragma:

  #pragma clang module import MODULE.NAME.HERE

that imports a module, and changes -E and -frewrite-includes to use it when
rewriting a #include that maps to a module import. We don't make any attempt
to use a native language syntax import if one exists, to get more consistent
output. (If in the future, @import and #include have different semantics in
some way, the pragma will track the #include semantics.)

llvm-svn: 301725
2017-04-29 00:34:47 +00:00
Richard Smith 3d8fceafe6 Commit some test changes somehow missed in r239789.
llvm-svn: 239791
2015-06-16 00:19:29 +00:00
Argyrios Kyrtzidis c3b4b79beb When emitting a preprocessed file with implicit module imports, make sure line directives are emitted in the next line.
rdar://13722737

llvm-svn: 180718
2013-04-29 17:26:22 +00:00
Argyrios Kyrtzidis a6444b1ce1 [frontend] When preprocessing, turn implicit module imports into @imports.
part of rdar://13610250

llvm-svn: 179144
2013-04-10 01:53:46 +00:00