clang  6.0.0svn
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. More...
 
using ConflictCallback = llvm::function_ref< void(ArrayRef< Module * > Path, Module *Conflict, StringRef Message)>
 A callback to call when a module conflict is found. More...
 

Public Member Functions

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

Detailed Description

A set of visible modules.

Definition at line 571 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 615 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 608 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 574 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 592 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 600 of file Module.h.

References clang::Module::getVisibilityID().

◆ isVisible()

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

Determine whether a module is visible.

Definition at line 595 of file Module.h.

Referenced by clang::Sema::isModuleVisible().

◆ 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 582 of file Module.h.

◆ setVisible()

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

Make a specific module visible.

Definition at line 553 of file Module.cpp.

References clang::Module::Exports, and clang::SourceLocation::isValid().

Referenced by clang::Sema::ActOnStartOfTranslationUnit().


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