clang 20.0.0git
Public Types | Public Member Functions | List of all members
clang::VisibleModuleSet Class Reference

A set of visible modules. More...

#include "clang/Basic/Module.h"

Public Types

using VisibleCallback = llvm::function_ref< void(Module *M)>
 A callback to call when a module is made visible (directly or indirectly) by a call to setVisible.
 
using ConflictCallback = llvm::function_ref< void(ArrayRef< Module * > Path, Module *Conflict, StringRef Message)>
 A callback to call when a module conflict is found.
 

Public Member Functions

 VisibleModuleSet ()=default
 
 VisibleModuleSet (VisibleModuleSet &&O)
 
VisibleModuleSetoperator= (VisibleModuleSet &&O)
 Move from another visible modules set.
 
unsigned getGeneration () const
 Get the current visibility generation.
 
bool isVisible (const Module *M) const
 Determine whether a module is visible.
 
SourceLocation getImportLoc (const Module *M) const
 Get the location at which the import of a module was triggered.
 
void setVisible (Module *M, SourceLocation Loc, VisibleCallback Vis=[](Module *) {}, ConflictCallback Cb=[](ArrayRef< Module * >, Module *, StringRef) {})
 Make a specific module visible.
 

Detailed Description

A set of visible modules.

Definition at line 837 of file Module.h.

Member Typedef Documentation

◆ ConflictCallback

using clang::VisibleModuleSet::ConflictCallback = llvm::function_ref<void(ArrayRef<Module *> Path, Module *Conflict, StringRef Message)>

A callback to call when a module conflict is found.

Path consists of a sequence of modules from the conflicting module to the one made visible, where each was exported by the next.

Definition at line 879 of file Module.h.

◆ VisibleCallback

using clang::VisibleModuleSet::VisibleCallback = llvm::function_ref<void(Module *M)>

A callback to call when a module is made visible (directly or indirectly) by a call to setVisible.

Definition at line 874 of file Module.h.

Constructor & Destructor Documentation

◆ VisibleModuleSet() [1/2]

clang::VisibleModuleSet::VisibleModuleSet ( )
default

◆ VisibleModuleSet() [2/2]

clang::VisibleModuleSet::VisibleModuleSet ( VisibleModuleSet &&  O)
inline

Definition at line 840 of file Module.h.

Member Function Documentation

◆ getGeneration()

unsigned clang::VisibleModuleSet::getGeneration ( ) const
inline

Get the current visibility generation.

Incremented each time the set of visible modules changes in any way.

Definition at line 858 of file Module.h.

◆ getImportLoc()

SourceLocation clang::VisibleModuleSet::getImportLoc ( const Module M) const
inline

Get the location at which the import of a module was triggered.

Definition at line 866 of file Module.h.

References clang::Module::getVisibilityID().

Referenced by clang::Sema::ActOnModuleDecl(), and isVisible().

◆ isVisible()

bool clang::VisibleModuleSet::isVisible ( const Module M) const
inline

◆ operator=()

VisibleModuleSet & clang::VisibleModuleSet::operator= ( VisibleModuleSet &&  O)
inline

Move from another visible modules set.

Guaranteed to leave the source empty and bump the generation on both.

Definition at line 848 of file Module.h.

◆ setVisible()

void VisibleModuleSet::setVisible ( Module M,
SourceLocation  Loc,
VisibleCallback  Vis = [](Module *) {},
ConflictCallback  Cb = [](ArrayRef<Module *>, Module *,                                           StringRef) {} 
)

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