summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2014-07-23 15:30:23 +0000
committerBen Langmuir <blangmuir@apple.com>2014-07-23 15:30:23 +0000
commitb537a3a651803cd11edf0e5c33f6cfa397dd9d10 (patch)
tree61e1fcea26817dc4a7b8f2297e3527c3b442bb25 /clang/lib/Lex
parent002fb104bd0a53df5917a5e2a3bfd93cb96d9bd4 (diff)
downloadbcm5719-llvm-b537a3a651803cd11edf0e5c33f6cfa397dd9d10.tar.gz
bcm5719-llvm-b537a3a651803cd11edf0e5c33f6cfa397dd9d10.zip
Add stopgap option -fmodule-implementation-of <name>
This flag specifies that we are building an implementation file of the module <name>, preventing importing <name> as a module. This does not consider this to be the 'current module' for the purposes of doing modular checks like decluse or non-modular-include warnings, unlike -fmodule-name. This is needed as a stopgap until: 1) we can resolve relative includes to a VFS-mapped module (or can safely import a header textually and as part of a module) and ideally 2) we can safely do incremental rebuilding when implementation files import submodules. llvm-svn: 213767
Diffstat (limited to 'clang/lib/Lex')
-rw-r--r--clang/lib/Lex/PPDirectives.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 1741c302f33..a8e27c71da8 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -1539,7 +1539,9 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc,
// If we are supposed to import a module rather than including the header,
// do so now.
- if (SuggestedModule && getLangOpts().Modules) {
+ if (SuggestedModule && getLangOpts().Modules &&
+ SuggestedModule.getModule()->getTopLevelModuleName() !=
+ getLangOpts().ImplementationOfModule) {
// Compute the module access path corresponding to this module.
// FIXME: Should we have a second loadModule() overload to avoid this
// extra lookup step?
OpenPOWER on IntegriCloud