aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/Module.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-20 00:28:52 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-20 00:28:52 +0000
commit305dc3ebaa0bea5f3b789e4b54afc79c25907615 (patch)
treedfe626b56bee645cfac86bdb52d0c63bcd2bdb47 /include/clang/Basic/Module.h
parent6446c3e3600032c5f17ca2324a4581b9301afa59 (diff)
Detect when mapping a #include/#import over to a submodule ends up
hitting a submodule that was never actually created, e.g., because that header wasn't parsed. In such cases, complain (because the module's umbrella headers don't cover everything) and fall back to including the header. Later, we'll add a warning at module-build time to catch all such cases. However, this fallback is important to eliminate assertions in the ASTWriter when this happens. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146933 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Module.h')
-rw-r--r--include/clang/Basic/Module.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/clang/Basic/Module.h b/include/clang/Basic/Module.h
index aef2db0fed..96b716e0ce 100644
--- a/include/clang/Basic/Module.h
+++ b/include/clang/Basic/Module.h
@@ -58,6 +58,9 @@ public:
/// \brief The headers that are part of this module.
llvm::SmallVector<const FileEntry *, 2> Headers;
+ /// \brief Whether this module was loaded from a module file.
+ unsigned IsFromModuleFile : 1;
+
/// \brief Whether this is a framework module.
unsigned IsFramework : 1;
@@ -131,17 +134,18 @@ public:
explicit Module(StringRef Name, SourceLocation DefinitionLoc,
bool IsFramework)
: Name(Name), DefinitionLoc(DefinitionLoc), Parent(0), Umbrella(),
- IsFramework(IsFramework), IsExplicit(false), InferSubmodules(false),
- InferExplicitSubmodules(false), InferExportWildcard(false),
- NameVisibility(Hidden) { }
+ IsFromModuleFile(false), IsFramework(IsFramework), IsExplicit(false),
+ InferSubmodules(false), InferExplicitSubmodules(false),
+ InferExportWildcard(false), NameVisibility(Hidden) { }
/// \brief Construct a new module or submodule.
Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent,
bool IsFramework, bool IsExplicit)
: Name(Name), DefinitionLoc(DefinitionLoc), Parent(Parent),
- Umbrella(), IsFramework(IsFramework), IsExplicit(IsExplicit),
- InferSubmodules(false), InferExplicitSubmodules(false),
- InferExportWildcard(false),NameVisibility(Hidden) { }
+ Umbrella(), IsFromModuleFile(false), IsFramework(IsFramework),
+ IsExplicit(IsExplicit), InferSubmodules(false),
+ InferExplicitSubmodules(false), InferExportWildcard(false),
+ NameVisibility(Hidden) { }
~Module();