]> granicus.if.org Git - clang/commit
Add #pragma clang module begin/end pragmas and generate them when preprocessing a...
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 4 May 2017 00:29:54 +0000 (00:29 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 4 May 2017 00:29:54 +0000 (00:29 +0000)
commitf195b64c780cc36265ea7d814e5d8c783638c08f
treeb767e94ab6cd3c8b26494fb630c67699caee37fd
parentc6d85a3ada92e8597af5b0bfe1478085675a5038
Add #pragma clang module begin/end pragmas and generate them when preprocessing a module.

These pragmas are intended to simulate the effect of entering or leaving a file
with an associated module. This is not completely implemented yet: declarations
between the pragmas will not be attributed to the correct module, but macro
visibility is already functional.

Modules named by #pragma clang module begin must already be known to clang (in
some module map that's either loaded or on the search path).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302098 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/clang/Basic/DiagnosticLexKinds.td
include/clang/Lex/Preprocessor.h
lib/Frontend/PrintPreprocessedOutput.cpp
lib/Frontend/Rewrite/InclusionRewriter.cpp
lib/Lex/PPDirectives.cpp
lib/Lex/PPLexerChange.cpp
lib/Lex/PPMacroExpansion.cpp
lib/Lex/Pragma.cpp
lib/Lex/Preprocessor.cpp
test/Modules/Inputs/preprocess/file2.h [new file with mode: 0644]
test/Modules/Inputs/preprocess/module.modulemap
test/Modules/preprocess-module.cpp
test/Preprocessor/pragma_module.c