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;
34 llvm::PointerIntPair<Module *, 1, bool> Storage;
40 : Storage(module, missingExpected) { }
42 operator Module *()
const {
return Storage.getPointer(); }
61 BuildingModule(BuildingModule),
68 return BuildingModule;
72 BuildingModule = BuildingModuleFlag;
97 bool IsInclusionDirective) = 0;
Defines the clang::Module class, which describes a module in the source code.
virtual GlobalModuleIndex * loadGlobalModuleIndex(SourceLocation TriggerLoc)=0
Load, create, or return global module. This function returns an existing global module index...
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.
ModuleLoader(bool BuildingModule=false)
Describes the result of attempting to load a module.
ModuleLoadResult(Module *module, bool missingExpected)
virtual bool lookupMissingImports(StringRef Name, SourceLocation TriggerLoc)=0
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
A global index for a set of module files, providing information about the identifiers within those mo...
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.
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.
virtual void makeModuleVisible(Module *Mod, Module::NameVisibilityKind Visibility, SourceLocation ImportLoc)=0
Make the given module visible.