14 #ifndef LLVM_CLANG_LEX_MODULELOADER_H 15 #define LLVM_CLANG_LEX_MODULELOADER_H 20 #include "llvm/ADT/ArrayRef.h" 21 #include "llvm/ADT/PointerIntPair.h" 22 #include "llvm/ADT/StringRef.h" 27 class GlobalModuleIndex;
52 llvm::PointerIntPair<Module *, 2, LoadResultKind>
Storage;
58 operator Module *()
const {
return Storage.getPointer(); }
86 : BuildingModule(BuildingModule) {}
92 return BuildingModule;
97 BuildingModule = BuildingModuleFlag;
123 bool IsInclusionDirective) = 0;
132 virtual void createModuleFromSource(
SourceLocation Loc, StringRef ModuleName,
133 StringRef Source) = 0;
136 virtual void makeModuleVisible(
Module *Mod,
157 virtual bool lookupMissingImports(StringRef Name,
160 bool HadFatalFailure =
false;
168 bool IsInclusionDirective)
override {
173 StringRef Source)
override {}
190 #endif // LLVM_CLANG_LEX_MODULELOADER_H bool buildingModule() const
Returns true if this instance is building a module.
A module loader that doesn't know how to create or load modules.
Describes a module or submodule.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Visibility
Describes the different kinds of visibility that a declaration may have.
ModuleLoadResult(LoadResultKind Kind)
ModuleLoader(bool BuildingModule=false)
Describes the result of attempting to load a module.
ModuleLoadResult loadModule(SourceLocation ImportLoc, ModuleIdPath Path, Module::NameVisibilityKind Visibility, bool IsInclusionDirective) override
Attempt to load the given module.
GlobalModuleIndex * loadGlobalModuleIndex(SourceLocation TriggerLoc) override
Load, create, or return global module.
ModuleLoadResult()=default
bool isNormal() const
Determines whether this is a normal return, whether or not loading the module was successful...
Encodes a location in the source.
bool isConfigMismatch() const
Determines whether the module failed to load due to a configuration mismatch with an explicitly-named...
Defines the clang::Module class, which describes a module in the source code.
A global index for a set of module files, providing information about the identifiers within those mo...
Dataflow Directional Tag Classes.
bool isMissingExpected() const
Determines whether the module, which failed to load, was actually a submodule that we expected to see...
llvm::PointerIntPair< Module *, 2, LoadResultKind > Storage
void createModuleFromSource(SourceLocation ImportLoc, StringRef ModuleName, StringRef Source) override
Attempt to create the given module from the specified source buffer.
Abstract interface for a module loader.
Defines the clang::SourceLocation class and associated facilities.
NameVisibilityKind
Describes the visibility of the various names within a particular module.
void setBuildingModule(bool BuildingModuleFlag)
Flag indicating whether this instance is building a module.
bool lookupMissingImports(StringRef Name, SourceLocation TriggerLoc) override
Check global module index for missing imports.
ModuleLoadResult(Module *M)
void makeModuleVisible(Module *Mod, Module::NameVisibilityKind Visibility, SourceLocation ImportLoc) override
Make the given module visible.