diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Basic/DiagnosticLexKinds.td | 2 | ||||
-rw-r--r-- | include/clang/Lex/ModuleMap.h | 24 |
2 files changed, 21 insertions, 5 deletions
diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td index 5925ef8bd6..0f9a8214c5 100644 --- a/include/clang/Basic/DiagnosticLexKinds.td +++ b/include/clang/Basic/DiagnosticLexKinds.td @@ -392,7 +392,7 @@ def note_mmap_prev_definition : Note<"previously defined here">; def err_mmap_header_conflict : Error< "header '%0' is already part of module '%1'">; def err_mmap_header_not_found : Error< - "%select{|umbrella }0 header '%1' not found">; + "%select{|umbrella }0header '%1' not found">; def err_mmap_umbrella_header_conflict : Error< "module '%0' already has an umbrella header ('%1')">; def err_mmap_umbrella_header_submodule : Error< 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; |