aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex/ModuleMap.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Lex/ModuleMap.h')
-rw-r--r--include/clang/Lex/ModuleMap.h79
1 files changed, 2 insertions, 77 deletions
diff --git a/include/clang/Lex/ModuleMap.h b/include/clang/Lex/ModuleMap.h
index c5727a9c35..b93e65a4a5 100644
--- a/include/clang/Lex/ModuleMap.h
+++ b/include/clang/Lex/ModuleMap.h
@@ -17,6 +17,7 @@
#define LLVM_CLANG_LEX_MODULEMAP_H
#include "clang/Basic/LangOptions.h"
+#include "clang/Basic/Module.h"
#include "clang/Basic/SourceManager.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
@@ -35,82 +36,6 @@ class DiagnosticsEngine;
class ModuleMapParser;
class ModuleMap {
-public:
- /// \brief Describes a module or submodule.
- struct Module {
- /// \brief The name of this module.
- std::string Name;
-
- /// \brief The location of the module definition.
- SourceLocation DefinitionLoc;
-
- /// \brief The parent of this module. This will be NULL for the top-level
- /// module.
- Module *Parent;
-
- /// \brief The umbrella header, if any.
- ///
- /// Only the top-level module can have an umbrella header.
- const FileEntry *UmbrellaHeader;
-
- /// \brief The submodules of this module, indexed by name.
- llvm::StringMap<Module *> SubModules;
-
- /// \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,
- bool IsFramework)
- : Name(Name), DefinitionLoc(DefinitionLoc), Parent(0), UmbrellaHeader(0),
- IsFramework(IsFramework), IsExplicit(false) { }
-
- /// \brief Construct a new module or submodule.
- Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent,
- bool IsFramework, bool IsExplicit)
- : Name(Name), DefinitionLoc(DefinitionLoc), Parent(Parent),
- UmbrellaHeader(0), IsFramework(IsFramework), IsExplicit(IsExplicit) {
- }
-
- ~Module();
-
- /// \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;
-
- /// \brief Retrieve the name of the top-level module.
- ///
- StringRef getTopLevelModuleName() const;
-
- /// \brief Print the module map for this module to the given stream.
- ///
- void print(llvm::raw_ostream &OS, unsigned Indent = 0) const;
-
- /// \brief Dump the contents of this module to the given output stream.
- void dump() const;
- };
-
-private:
SourceManager *SourceMgr;
llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags;
LangOptions LangOpts;
@@ -192,7 +117,7 @@ public:
///
/// \returns The file entry for the module map file containing the given
/// module, or NULL if the module definition was inferred.
- const FileEntry *getContainingModuleMapFile(ModuleMap::Module *Module);
+ const FileEntry *getContainingModuleMapFile(Module *Module);
/// \brief Parse the given module map file, and record any modules we
/// encounter.