14 #ifndef LLVM_CLANG_LEX_MODULELOADER_H
15 #define LLVM_CLANG_LEX_MODULELOADER_H
19 #include "llvm/ADT/ArrayRef.h"
20 #include "llvm/ADT/PointerIntPair.h"
24 class GlobalModuleIndex;
45 llvm::PointerIntPair<Module *, 2, LoadResultKind>
Storage;
74 BuildingModule(BuildingModule),
81 return BuildingModule;
85 BuildingModule = BuildingModuleFlag;
110 bool IsInclusionDirective) = 0;
120 StringRef Source) = 0;
155 bool IsInclusionDirective)
override {
160 StringRef Source)
override {}
Defines the clang::Module class, which describes a module in the source code.
A module loader that doesn't know how to load modules.
virtual GlobalModuleIndex * loadGlobalModuleIndex(SourceLocation TriggerLoc)=0
Load, create, or return global module.
bool buildingModule() const
Returns true if this instance is building a module.
ArrayRef< std::pair< IdentifierInfo *, SourceLocation > > ModuleIdPath
A sequence of identifier/location pairs used to describe a particular module or submodule, e.g., std.vector.
Describes a module or submodule.
bool isMissingExpected() const
Determines whether the module, which failed to load, was actually a submodule that we expected to see...
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.
virtual bool lookupMissingImports(StringRef Name, SourceLocation TriggerLoc)=0
Check global module index for missing imports.
void loadModuleFromSource(SourceLocation ImportLoc, StringRef ModuleName, StringRef Source) override
Attempt to load the given module from the specified source buffer.
Encodes a location in the source.
A global index for a set of module files, providing information about the identifiers within those mo...
bool isConfigMismatch() const
Determines whether the module failed to load due to a configuration mismatch with an explicitly-named...
llvm::PointerIntPair< Module *, 2, LoadResultKind > Storage
virtual ModuleLoadResult loadModule(SourceLocation ImportLoc, ModuleIdPath Path, Module::NameVisibilityKind Visibility, bool IsInclusionDirective)=0
Attempt to load the given module.
Abstract interface for a module loader.
virtual void loadModuleFromSource(SourceLocation Loc, StringRef ModuleName, StringRef Source)=0
Attempt to load the given module from the specified source buffer.
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.
virtual void makeModuleVisible(Module *Mod, Module::NameVisibilityKind Visibility, SourceLocation ImportLoc)=0
Make the given module visible.
ModuleLoadResult(Module *M)
void makeModuleVisible(Module *Mod, Module::NameVisibilityKind Visibility, SourceLocation ImportLoc) override
Make the given module visible.