diff options
author | dim <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
commit | 173a4f43a911175643bda81ee675e8d9269056ea (patch) | |
tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /include/clang/Lex/ModuleLoader.h | |
parent | 88f7a7d5251a2d813460274c92decc143a11569b (diff) | |
download | FreeBSD-src-173a4f43a911175643bda81ee675e8d9269056ea.zip FreeBSD-src-173a4f43a911175643bda81ee675e8d9269056ea.tar.gz |
Vendor import of clang RELEASE_350/final tag r216957 (effectively, 3.5.0 release):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_350/final@216957
Diffstat (limited to 'include/clang/Lex/ModuleLoader.h')
-rw-r--r-- | include/clang/Lex/ModuleLoader.h | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/include/clang/Lex/ModuleLoader.h b/include/clang/Lex/ModuleLoader.h index 254ab36..7869799 100644 --- a/include/clang/Lex/ModuleLoader.h +++ b/include/clang/Lex/ModuleLoader.h @@ -21,6 +21,7 @@ namespace clang { +class GlobalModuleIndex; class IdentifierInfo; class Module; @@ -53,11 +54,24 @@ public: /// for resolving a module name (e.g., "std") to an actual module file, and /// then loading that module. class ModuleLoader { + // Building a module if true. + bool BuildingModule; public: - ModuleLoader() : HadFatalFailure(false) {} + explicit ModuleLoader(bool BuildingModule = false) : + BuildingModule(BuildingModule), + HadFatalFailure(false) {} virtual ~ModuleLoader(); + /// \brief Returns true if this instance is building a module. + bool buildingModule() const { + return BuildingModule; + } + /// \brief Flag indicating whether this instance is building a module. + void setBuildingModule(bool BuildingModuleFlag) { + BuildingModule = BuildingModuleFlag; + } + /// \brief Attempt to load the given module. /// /// This routine attempts to load the module described by the given @@ -88,6 +102,26 @@ public: SourceLocation ImportLoc, bool Complain) = 0; + /// \brief Load, create, or return global module. + /// This function returns an existing global module index, if one + /// had already been loaded or created, or loads one if it + /// exists, or creates one if it doesn't exist. + /// Also, importantly, if the index doesn't cover all the modules + /// in the module map, it will be update to do so here, because + /// of its use in searching for needed module imports and + /// associated fixit messages. + /// \param TriggerLoc The location for what triggered the load. + /// \returns Returns null if load failed. + virtual GlobalModuleIndex *loadGlobalModuleIndex( + SourceLocation TriggerLoc) = 0; + + /// Check global module index for missing imports. + /// \param Name The symbol name to look for. + /// \param TriggerLoc The location for what triggered the load. + /// \returns Returns true if any modules with that symbol found. + virtual bool lookupMissingImports(StringRef Name, + SourceLocation TriggerLoc) = 0; + bool HadFatalFailure; }; |