clang 23.0.0git
clang::ModuleFileName Class Reference

Identifies a module file to be loaded. More...

#include "clang/Basic/Module.h"

Public Member Functions

 ModuleFileName ()=default
 Creates an empty module file name.
unsigned getImplicitModuleSuffixLength () const
 Returns the suffix length for an implicit module name, zero otherwise.
bool isInMemory () const
 Returns true iff this is an in-memory module file, false otherwise.
unsigned getRawKind () const
 Returns the raw value representing the kind of the module file.
StringRef str () const
 Returns the plain module file name.
 operator StringRef () const
 Converts to StringRef representing the plain module file name.
bool empty () const
 Checks whether the module file name is empty.

Static Public Member Functions

static ModuleFileName makeFromRaw (StringRef Name, unsigned RawKind)
 Creates a file name from the raw kind value.
static ModuleFileName makeInMemory (StringRef Name)
 Creates a file name for an in-memory module.
static ModuleFileName makeExplicit (std::string Name)
 Creates a file name for an explicit module.
static ModuleFileName makeExplicit (StringRef Name)
 Creates a file name for an explicit module.
static ModuleFileName makeImplicit (std::string Name, unsigned SuffixLength)
 Creates a file name for an implicit module.
static ModuleFileName makeImplicit (StringRef Name, unsigned SuffixLength)
 Creates a file name for an implicit module.

Detailed Description

Identifies a module file to be loaded.

For implicitly-built module files, the path is split into the module cache path and the module file name with the (optional) context hash. For all other types of module files, this is just the file system path.

Definition at line 109 of file Module.h.

Constructor & Destructor Documentation

◆ ModuleFileName()

clang::ModuleFileName::ModuleFileName ( )
default

Creates an empty module file name.

Referenced by makeExplicit(), makeExplicit(), makeFromRaw(), makeImplicit(), makeImplicit(), and makeInMemory().

Member Function Documentation

◆ empty()

bool clang::ModuleFileName::empty ( ) const
inline

Checks whether the module file name is empty.

Definition at line 194 of file Module.h.

Referenced by selectModuleSource().

◆ getImplicitModuleSuffixLength()

unsigned clang::ModuleFileName::getImplicitModuleSuffixLength ( ) const
inline

Returns the suffix length for an implicit module name, zero otherwise.

Definition at line 171 of file Module.h.

Referenced by clang::serialization::ModuleManager::makeKey().

◆ getRawKind()

unsigned clang::ModuleFileName::getRawKind ( ) const
inline

Returns the raw value representing the kind of the module file.

Definition at line 185 of file Module.h.

◆ isInMemory()

bool clang::ModuleFileName::isInMemory ( ) const
inline

Returns true iff this is an in-memory module file, false otherwise.

Definition at line 182 of file Module.h.

Referenced by clang::serialization::ModuleManager::makeKey().

◆ makeExplicit() [1/2]

◆ makeExplicit() [2/2]

ModuleFileName clang::ModuleFileName::makeExplicit ( StringRef Name)
inlinestatic

Creates a file name for an explicit module.

Definition at line 150 of file Module.h.

References makeExplicit(), and ModuleFileName().

◆ makeFromRaw()

ModuleFileName clang::ModuleFileName::makeFromRaw ( StringRef Name,
unsigned RawKind )
inlinestatic

Creates a file name from the raw kind value.

Definition at line 126 of file Module.h.

References clang::File, and ModuleFileName().

◆ makeImplicit() [1/2]

ModuleFileName clang::ModuleFileName::makeImplicit ( std::string Name,
unsigned SuffixLength )
inlinestatic

Creates a file name for an implicit module.

Definition at line 155 of file Module.h.

References clang::File, and ModuleFileName().

Referenced by makeImplicit().

◆ makeImplicit() [2/2]

ModuleFileName clang::ModuleFileName::makeImplicit ( StringRef Name,
unsigned SuffixLength )
inlinestatic

Creates a file name for an implicit module.

Definition at line 166 of file Module.h.

References makeImplicit(), and ModuleFileName().

◆ makeInMemory()

ModuleFileName clang::ModuleFileName::makeInMemory ( StringRef Name)
inlinestatic

Creates a file name for an in-memory module.

Definition at line 134 of file Module.h.

References clang::File, and ModuleFileName().

Referenced by createASTReader(), and clang::ASTUnit::LoadFromASTFile().

◆ operator StringRef()

clang::ModuleFileName::operator StringRef ( ) const
inline

Converts to StringRef representing the plain module file name.

Definition at line 191 of file Module.h.

◆ str()

StringRef clang::ModuleFileName::str ( ) const
inline

Returns the plain module file name.

Definition at line 188 of file Module.h.

Referenced by createPrebuiltModuleDep().


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