clang API Documentation
Abstract interface for a module loader. More...
#include <ModuleLoader.h>
Public Member Functions | |
ModuleLoader (bool BuildingModule=false) | |
virtual | ~ModuleLoader () |
bool | buildingModule () const |
Returns true if this instance is building a module. | |
void | setBuildingModule (bool BuildingModuleFlag) |
Flag indicating whether this instance is building a module. | |
virtual ModuleLoadResult | loadModule (SourceLocation ImportLoc, ModuleIdPath Path, Module::NameVisibilityKind Visibility, bool IsInclusionDirective)=0 |
Attempt to load the given module. | |
virtual void | makeModuleVisible (Module *Mod, Module::NameVisibilityKind Visibility, SourceLocation ImportLoc, bool Complain)=0 |
Make the given module visible. | |
virtual GlobalModuleIndex * | loadGlobalModuleIndex (SourceLocation TriggerLoc)=0 |
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. | |
virtual bool | lookupMissingImports (StringRef Name, SourceLocation TriggerLoc)=0 |
Public Attributes | |
bool | HadFatalFailure |
Abstract interface for a module loader.
This abstract interface describes a module loader, which is responsible for resolving a module name (e.g., "std") to an actual module file, and then loading that module.
Definition at line 56 of file ModuleLoader.h.
clang::ModuleLoader::ModuleLoader | ( | bool | BuildingModule = false | ) | [inline, explicit] |
Definition at line 60 of file ModuleLoader.h.
ModuleLoader::~ModuleLoader | ( | ) | [virtual] |
Definition at line 845 of file Preprocessor.cpp.
bool clang::ModuleLoader::buildingModule | ( | ) | const [inline] |
Returns true if this instance is building a module.
Definition at line 67 of file ModuleLoader.h.
Referenced by clang::CompilerInstance::loadGlobalModuleIndex(), and clang::CompilerInstance::lookupMissingImports().
virtual GlobalModuleIndex* clang::ModuleLoader::loadGlobalModuleIndex | ( | SourceLocation | TriggerLoc | ) | [pure virtual] |
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.
TriggerLoc | The location for what triggered the load. |
Implemented in clang::ASTUnit, and clang::CompilerInstance.
virtual ModuleLoadResult clang::ModuleLoader::loadModule | ( | SourceLocation | ImportLoc, |
ModuleIdPath | Path, | ||
Module::NameVisibilityKind | Visibility, | ||
bool | IsInclusionDirective | ||
) | [pure virtual] |
Attempt to load the given module.
This routine attempts to load the module described by the given parameters.
ImportLoc | The location of the 'import' keyword. |
Path | The identifiers (and their locations) of the module "path", e.g., "std.vector" would be split into "std" and "vector". |
Visibility | The visibility provided for the names in the loaded module. |
IsInclusionDirective | Indicates that this module is being loaded implicitly, due to the presence of an inclusion directive. Otherwise, it is being loaded due to an import declaration. |
Implemented in clang::ASTUnit, and clang::CompilerInstance.
Referenced by clang::Sema::ActOnModuleImport(), and clang::Preprocessor::LexAfterModuleImport().
virtual bool clang::ModuleLoader::lookupMissingImports | ( | StringRef | Name, |
SourceLocation | TriggerLoc | ||
) | [pure virtual] |
Check global module index for missing imports.
Name | The symbol name to look for. |
TriggerLoc | The location for what triggered the load. |
Implemented in clang::ASTUnit, and clang::CompilerInstance.
virtual void clang::ModuleLoader::makeModuleVisible | ( | Module * | Mod, |
Module::NameVisibilityKind | Visibility, | ||
SourceLocation | ImportLoc, | ||
bool | Complain | ||
) | [pure virtual] |
Make the given module visible.
Implemented in clang::ASTUnit, and clang::CompilerInstance.
Referenced by clang::Sema::ActOnModuleInclude(), and clang::Sema::createImplicitModuleImportForErrorRecovery().
void clang::ModuleLoader::setBuildingModule | ( | bool | BuildingModuleFlag | ) | [inline] |
Flag indicating whether this instance is building a module.
Definition at line 71 of file ModuleLoader.h.
Definition at line 125 of file ModuleLoader.h.
Referenced by clang::Preprocessor::hadModuleLoaderFatalFailure(), clang::CompilerInstance::hadModuleLoaderFatalFailure(), clang::PCHGenerator::HandleTranslationUnit(), and clang::CompilerInstance::loadModule().