diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-11-17 22:09:43 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-11-17 22:09:43 +0000 |
commit | a865405e4155e8ea83d7ff1a1d8316907c300897 (patch) | |
tree | a62c24be2002ff7be85c34afc0de4cebbf63602d /include/clang/Lex/ModuleMap.h | |
parent | a4581a120cbcc373b02f13ef744591679f0c2d8c (diff) |
Add the notion of "framework" modules to module maps. Framework
modules (obviously) describe frameworks, and understand the header
layout of frameworks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144921 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/ModuleMap.h')
-rw-r--r-- | include/clang/Lex/ModuleMap.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/include/clang/Lex/ModuleMap.h b/include/clang/Lex/ModuleMap.h index b1eaebddb2..f4eb773e70 100644 --- a/include/clang/Lex/ModuleMap.h +++ b/include/clang/Lex/ModuleMap.h @@ -59,19 +59,23 @@ public: /// \brief The headers that are part of this module. llvm::SmallVector<const FileEntry *, 2> Headers; + /// \brief Whether this is a framework module. + bool IsFramework; + /// \brief Whether this is an explicit submodule. bool IsExplicit; /// \brief Construct a top-level module. - explicit Module(StringRef Name, SourceLocation DefinitionLoc) + explicit Module(StringRef Name, SourceLocation DefinitionLoc, + bool IsFramework) : Name(Name), DefinitionLoc(DefinitionLoc), Parent(0), UmbrellaHeader(0), - IsExplicit(false) { } + IsFramework(IsFramework), IsExplicit(false) { } /// \brief Construct a new module or submodule. Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent, - bool IsExplicit) + bool IsFramework, bool IsExplicit) : Name(Name), DefinitionLoc(DefinitionLoc), Parent(Parent), - UmbrellaHeader(0), IsExplicit(IsExplicit) { + UmbrellaHeader(0), IsFramework(IsFramework), IsExplicit(IsExplicit) { } ~Module(); @@ -79,6 +83,18 @@ public: /// \brief Determine whether this module is a submodule. bool isSubModule() const { return Parent != 0; } + /// \brief Determine whether this module is a part of a framework, + /// either because it is a framework module or because it is a submodule + /// of a framework module. + bool isPartOfFramework() const { + for (const Module *Mod = this; Mod; Mod = Mod->Parent) + if (Mod->IsFramework) + return true; + + return false; + } + + /// \brief Retrieve the full name of this module, including the path from /// its top-level module. std::string getFullModuleName() const; |