clang  14.0.0git
Public Member Functions | List of all members
clang::TrivialModuleLoader Class Reference

A module loader that doesn't know how to create or load modules. More...

#include "clang/Lex/ModuleLoader.h"

Inheritance diagram for clang::TrivialModuleLoader:
Inheritance graph
[legend]
Collaboration diagram for clang::TrivialModuleLoader:
Collaboration graph
[legend]

Public Member Functions

ModuleLoadResult loadModule (SourceLocation ImportLoc, ModuleIdPath Path, Module::NameVisibilityKind Visibility, bool IsInclusionDirective) override
 Attempt to load the given module. More...
 
void createModuleFromSource (SourceLocation ImportLoc, StringRef ModuleName, StringRef Source) override
 Attempt to create the given module from the specified source buffer. More...
 
void makeModuleVisible (Module *Mod, Module::NameVisibilityKind Visibility, SourceLocation ImportLoc) override
 Make the given module visible. More...
 
GlobalModuleIndexloadGlobalModuleIndex (SourceLocation TriggerLoc) override
 Load, create, or return global module. More...
 
bool lookupMissingImports (StringRef Name, SourceLocation TriggerLoc) override
 Check global module index for missing imports. More...
 
- Public Member Functions inherited from clang::ModuleLoader
 ModuleLoader (bool BuildingModule=false)
 
virtual ~ModuleLoader ()
 
bool buildingModule () const
 Returns true if this instance is building a module. More...
 
void setBuildingModule (bool BuildingModuleFlag)
 Flag indicating whether this instance is building a module. More...
 

Additional Inherited Members

- Public Attributes inherited from clang::ModuleLoader
bool HadFatalFailure = false
 

Detailed Description

A module loader that doesn't know how to create or load modules.

Definition at line 161 of file ModuleLoader.h.

Member Function Documentation

◆ createModuleFromSource()

void clang::TrivialModuleLoader::createModuleFromSource ( SourceLocation  Loc,
StringRef  ModuleName,
StringRef  Source 
)
inlineoverridevirtual

Attempt to create the given module from the specified source buffer.

Does not load the module or make any submodule visible; for that, use loadModule and makeModuleVisible.

Parameters
LocThe location at which to create the module.
ModuleNameThe name of the module to create.
SourceThe source of the module: a (preprocessed) module map.

Implements clang::ModuleLoader.

Definition at line 169 of file ModuleLoader.h.

◆ loadGlobalModuleIndex()

GlobalModuleIndex* clang::TrivialModuleLoader::loadGlobalModuleIndex ( SourceLocation  TriggerLoc)
inlineoverridevirtual

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.

Parameters
TriggerLocThe location for what triggered the load.
Returns
Returns null if load failed.

Implements clang::ModuleLoader.

Definition at line 175 of file ModuleLoader.h.

◆ loadModule()

ModuleLoadResult clang::TrivialModuleLoader::loadModule ( SourceLocation  ImportLoc,
ModuleIdPath  Path,
Module::NameVisibilityKind  Visibility,
bool  IsInclusionDirective 
)
inlineoverridevirtual

Attempt to load the given module.

This routine attempts to load the module described by the given parameters. If there is a module cache, this may implicitly compile the module before loading it.

Parameters
ImportLocThe location of the 'import' keyword.
PathThe identifiers (and their locations) of the module "path", e.g., "std.vector" would be split into "std" and "vector".
VisibilityThe visibility provided for the names in the loaded module.
IsInclusionDirectiveIndicates 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.
Returns
If successful, returns the loaded module. Otherwise, returns NULL to indicate that the module could not be loaded.

Implements clang::ModuleLoader.

Definition at line 163 of file ModuleLoader.h.

◆ lookupMissingImports()

bool clang::TrivialModuleLoader::lookupMissingImports ( StringRef  Name,
SourceLocation  TriggerLoc 
)
inlineoverridevirtual

Check global module index for missing imports.

Parameters
NameThe symbol name to look for.
TriggerLocThe location for what triggered the load.
Returns
Returns true if any modules with that symbol found.

Implements clang::ModuleLoader.

Definition at line 179 of file ModuleLoader.h.

◆ makeModuleVisible()

void clang::TrivialModuleLoader::makeModuleVisible ( Module Mod,
Module::NameVisibilityKind  Visibility,
SourceLocation  ImportLoc 
)
inlineoverridevirtual

Make the given module visible.

Implements clang::ModuleLoader.

Definition at line 172 of file ModuleLoader.h.


The documentation for this class was generated from the following file: