clang  6.0.0svn
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
clang::Module Class Reference

Describes a module or submodule. More...

#include "clang/Basic/Module.h"

Collaboration diagram for clang::Module:
Collaboration graph
[legend]

Classes

struct  Conflict
 A conflict between two modules. More...
 
struct  DirectoryName
 Information about a directory name as found in the module map file. More...
 
struct  Header
 Information about a header directive as found in the module map file. More...
 
struct  LinkLibrary
 A library or framework to link against when an entity from this module is used. More...
 
struct  UnresolvedConflict
 An unresolved conflict with another module. More...
 
struct  UnresolvedExportDecl
 Describes an exported module that has not yet been resolved (perhaps because the module it refers to has not yet been loaded). More...
 
struct  UnresolvedHeaderDirective
 Stored information about a header directive that was found in the module map file but has not been resolved to a file. More...
 

Public Types

enum  ModuleKind { ModuleMapModule, ModuleInterfaceUnit, GlobalModuleFragment }
 
enum  HeaderKind {
  HK_Normal, HK_Textual, HK_Private, HK_PrivateTextual,
  HK_Excluded
}
 
enum  NameVisibilityKind { Hidden, AllVisible }
 Describes the visibility of the various names within a particular module. More...
 
using Requirement = std::pair< std::string, bool >
 An individual requirement: a feature name and a flag indicating the required state of that feature. More...
 
using ExportDecl = llvm::PointerIntPair< Module *, 1, bool >
 Describes an exported module. More...
 
using submodule_iterator = std::vector< Module * >::iterator
 
using submodule_const_iterator = std::vector< Module * >::const_iterator
 

Public Member Functions

 Module (StringRef Name, SourceLocation DefinitionLoc, Module *Parent, bool IsFramework, bool IsExplicit, unsigned VisibilityID)
 Construct a new module or submodule. More...
 
 ~Module ()
 
bool isAvailable () const
 Determine whether this module is available for use within the current translation unit. More...
 
bool isAvailable (const LangOptions &LangOpts, const TargetInfo &Target, Requirement &Req, UnresolvedHeaderDirective &MissingHeader) const
 Determine whether this module is available for use within the current translation unit. More...
 
bool isSubModule () const
 Determine whether this module is a submodule. More...
 
bool isSubModuleOf (const Module *Other) const
 Determine whether this module is a submodule of the given other module. More...
 
bool isPartOfFramework () const
 Determine whether this module is a part of a framework, either because it is a framework module or because it is a submodule of a framework module. More...
 
bool isSubFramework () const
 Determine whether this module is a subframework of another framework. More...
 
void setParent (Module *M)
 Set the parent of this module. More...
 
std::string getFullModuleName (bool AllowStringLiterals=false) const
 Retrieve the full name of this module, including the path from its top-level module. More...
 
bool fullModuleNameIs (ArrayRef< StringRef > nameParts) const
 Whether the full name of this module is equal to joining nameParts with "."s. More...
 
ModulegetTopLevelModule ()
 Retrieve the top-level module for this (sub)module, which may be this module. More...
 
const ModulegetTopLevelModule () const
 Retrieve the top-level module for this (sub)module, which may be this module. More...
 
StringRef getTopLevelModuleName () const
 Retrieve the name of the top-level module. More...
 
const FileEntrygetASTFile () const
 The serialized AST file for this module, if one was created. More...
 
void setASTFile (const FileEntry *File)
 Set the serialized AST file for the top-level module of this module. More...
 
DirectoryName getUmbrellaDir () const
 Retrieve the directory for which this module serves as the umbrella. More...
 
Header getUmbrellaHeader () const
 Retrieve the header that serves as the umbrella header for this module. More...
 
bool hasUmbrellaDir () const
 Determine whether this module has an umbrella directory that is not based on an umbrella header. More...
 
void addTopHeader (const FileEntry *File)
 Add a top-level header associated with this module. More...
 
void addTopHeaderFilename (StringRef Filename)
 Add a top-level header filename associated with this module. More...
 
ArrayRef< const FileEntry * > getTopHeaders (FileManager &FileMgr)
 The top-level headers associated with this module. More...
 
bool directlyUses (const Module *Requested) const
 Determine whether this module has declared its intention to directly use another module. More...
 
void addRequirement (StringRef Feature, bool RequiredState, const LangOptions &LangOpts, const TargetInfo &Target)
 Add the given feature requirement to the list of features required by this module. More...
 
void markUnavailable (bool MissingRequirement=false)
 Mark this module and all of its submodules as unavailable. More...
 
ModulefindSubmodule (StringRef Name) const
 Find the submodule with the given name. More...
 
bool isModuleVisible (const Module *M) const
 Determine whether the specified module would be visible to a lookup at the end of this module. More...
 
unsigned getVisibilityID () const
 
submodule_iterator submodule_begin ()
 
submodule_const_iterator submodule_begin () const
 
submodule_iterator submodule_end ()
 
submodule_const_iterator submodule_end () const
 
llvm::iterator_range< submodule_iteratorsubmodules ()
 
llvm::iterator_range< submodule_const_iteratorsubmodules () const
 
void getExportedModules (SmallVectorImpl< Module *> &Exported) const
 Appends this module's list of exported modules to Exported. More...
 
void print (raw_ostream &OS, unsigned Indent=0) const
 Print the module map for this module to the given stream. More...
 
void dump () const
 Dump the contents of this module to the given output stream. More...
 

Static Public Member Functions

static StringRef getModuleInputBufferName ()
 

Public Attributes

std::string Name
 The name of this module. More...
 
SourceLocation DefinitionLoc
 The location of the module definition. More...
 
ModuleKind Kind = ModuleMapModule
 The kind of this module. More...
 
ModuleParent
 The parent of this module. More...
 
const DirectoryEntryDirectory = nullptr
 The build directory of this module. More...
 
std::string PresumedModuleMapFile
 The presumed file name for the module map defining this module. More...
 
llvm::PointerUnion< const DirectoryEntry *, const FileEntry * > Umbrella
 The umbrella header or directory. More...
 
ASTFileSignature Signature
 The module signature. More...
 
std::string UmbrellaAsWritten
 The name of the umbrella entry, as written in the module map. More...
 
std::string ExportAsModule
 The module through which entities defined in this module will eventually be exposed, for use in "private" modules. More...
 
SmallVector< Header, 2 > Headers [5]
 The headers that are part of this module. More...
 
SmallVector< UnresolvedHeaderDirective, 1 > UnresolvedHeaders
 Headers that are mentioned in the module map file but that we have not yet attempted to resolve to a file on the file system. More...
 
SmallVector< UnresolvedHeaderDirective, 1 > MissingHeaders
 Headers that are mentioned in the module map file but could not be found on the file system. More...
 
SmallVector< Requirement, 2 > Requirements
 The set of language features required to use this module. More...
 
unsigned IsMissingRequirement: 1
 Whether this module is missing a feature from Requirements. More...
 
unsigned HasIncompatibleModuleFile: 1
 Whether we tried and failed to load a module file for this module. More...
 
unsigned IsAvailable: 1
 Whether this module is available in the current translation unit. More...
 
unsigned IsFromModuleFile: 1
 Whether this module was loaded from a module file. More...
 
unsigned IsFramework: 1
 Whether this is a framework module. More...
 
unsigned IsExplicit: 1
 Whether this is an explicit submodule. More...
 
unsigned IsSystem: 1
 Whether this is a "system" module (which assumes that all headers in it are system headers). More...
 
unsigned IsExternC: 1
 Whether this is an 'extern "C"' module (which implicitly puts all headers in it within an 'extern "C"' block, and allows the module to be imported within such a block). More...
 
unsigned IsInferred: 1
 Whether this is an inferred submodule (module * { ... }). More...
 
unsigned InferSubmodules: 1
 Whether we should infer submodules for this module based on the headers. More...
 
unsigned InferExplicitSubmodules: 1
 Whether, when inferring submodules, the inferred submodules should be explicit. More...
 
unsigned InferExportWildcard: 1
 Whether, when inferring submodules, the inferr submodules should export all modules they import (e.g., the equivalent of "export *"). More...
 
unsigned ConfigMacrosExhaustive: 1
 Whether the set of configuration macros is exhaustive. More...
 
unsigned NoUndeclaredIncludes: 1
 Whether files in this module can only include non-modular headers and headers from used modules. More...
 
NameVisibilityKind NameVisibility
 The visibility of names within this particular module. More...
 
SourceLocation InferredSubmoduleLoc
 The location of the inferred submodule. More...
 
llvm::SmallSetVector< Module *, 2 > Imports
 The set of modules imported by this module, and on which this module depends. More...
 
SmallVector< ExportDecl, 2 > Exports
 The set of export declarations. More...
 
SmallVector< UnresolvedExportDecl, 2 > UnresolvedExports
 The set of export declarations that have yet to be resolved. More...
 
SmallVector< Module *, 2 > DirectUses
 The directly used modules. More...
 
SmallVector< ModuleId, 2 > UnresolvedDirectUses
 The set of use declarations that have yet to be resolved. More...
 
llvm::SmallVector< LinkLibrary, 2 > LinkLibraries
 The set of libraries or frameworks to link against when an entity from this module is used. More...
 
std::vector< std::string > ConfigMacros
 The set of "configuration macros", which are macros that (intentionally) change how this module is built. More...
 
std::vector< UnresolvedConflictUnresolvedConflicts
 The list of conflicts for which the module-id has not yet been resolved. More...
 
std::vector< ConflictConflicts
 The list of conflicts. More...
 

Static Public Attributes

static const int NumHeaderKinds = HK_Excluded + 1
 

Detailed Description

Describes a module or submodule.

Definition at line 65 of file Module.h.

Member Typedef Documentation

◆ ExportDecl

using clang::Module::ExportDecl = llvm::PointerIntPair<Module *, 1, bool>

Describes an exported module.

The pointer is the module being re-exported, while the bit will be true to indicate that this is a wildcard export.

Definition at line 281 of file Module.h.

◆ Requirement

using clang::Module::Requirement = std::pair<std::string, bool>

An individual requirement: a feature name and a flag indicating the required state of that feature.

Definition at line 192 of file Module.h.

◆ submodule_const_iterator

using clang::Module::submodule_const_iterator = std::vector<Module *>::const_iterator

Definition at line 536 of file Module.h.

◆ submodule_iterator

using clang::Module::submodule_iterator = std::vector<Module *>::iterator

Definition at line 535 of file Module.h.

Member Enumeration Documentation

◆ HeaderKind

Enumerator
HK_Normal 
HK_Textual 
HK_Private 
HK_PrivateTextual 
HK_Excluded 

Definition at line 140 of file Module.h.

◆ ModuleKind

Enumerator
ModuleMapModule 

This is a module that was defined by a module map and built out of header files.

ModuleInterfaceUnit 

This is a C++ Modules TS module interface unit.

GlobalModuleFragment 

This is a fragment of the global module within some C++ Modules TS module.

Definition at line 73 of file Module.h.

◆ NameVisibilityKind

Describes the visibility of the various names within a particular module.

Enumerator
Hidden 

All of the names in this module are hidden.

AllVisible 

All of the names in this module are visible.

Definition at line 260 of file Module.h.

Constructor & Destructor Documentation

◆ Module()

Module::Module ( StringRef  Name,
SourceLocation  DefinitionLoc,
Module Parent,
bool  IsFramework,
bool  IsExplicit,
unsigned  VisibilityID 
)

Construct a new module or submodule.

Definition at line 38 of file Module.cpp.

◆ ~Module()

Module::~Module ( )

Definition at line 64 of file Module.cpp.

Member Function Documentation

◆ addRequirement()

void Module::addRequirement ( StringRef  Feature,
bool  RequiredState,
const LangOptions LangOpts,
const TargetInfo Target 
)

Add the given feature requirement to the list of features required by this module.

Parameters
FeatureThe feature that is required by this module (and its submodules).
RequiredStateThe required state of this feature: true if it must be present, false if it must be absent.
LangOptsThe set of language options that will be used to evaluate the availability of this feature.
TargetThe target options that will be used to evaluate the availability of this feature.

Definition at line 232 of file Module.cpp.

References hasFeature(), markUnavailable(), and Requirements.

◆ addTopHeader()

void clang::Module::addTopHeader ( const FileEntry File)
inline

Add a top-level header associated with this module.

Definition at line 478 of file Module.h.

Referenced by collectModuleHeaderIncludes().

◆ addTopHeaderFilename()

void clang::Module::addTopHeaderFilename ( StringRef  Filename)
inline

Add a top-level header filename associated with this module.

Definition at line 484 of file Module.h.

◆ directlyUses()

bool Module::directlyUses ( const Module Requested) const

Determine whether this module has declared its intention to directly use another module.

Definition at line 214 of file Module.cpp.

References getTopLevelModule(), isSubModuleOf(), Name, and Parent.

Referenced by clang::ModuleMap::diagnoseHeaderInclusion(), and suggestModule().

◆ dump()

LLVM_DUMP_METHOD void Module::dump ( ) const

Dump the contents of this module to the given output stream.

Definition at line 549 of file Module.cpp.

References print().

◆ findSubmodule()

Module * Module::findSubmodule ( StringRef  Name) const

Find the submodule with the given name.

Returns
The submodule if found, or NULL otherwise.

Definition at line 272 of file Module.cpp.

◆ fullModuleNameIs()

bool Module::fullModuleNameIs ( ArrayRef< StringRef >  nameParts) const

Whether the full name of this module is equal to joining nameParts with "."s.

This is more efficient than getFullModuleName().

Definition at line 185 of file Module.cpp.

References Parent.

Referenced by shouldAddRequirement().

◆ getASTFile()

const FileEntry* clang::Module::getASTFile ( ) const
inline

The serialized AST file for this module, if one was created.

Definition at line 448 of file Module.h.

Referenced by clang::ExternalASTSource::ASTSourceDescriptor::ASTSourceDescriptor(), and clang::CompilerInstance::loadModule().

◆ getExportedModules()

void Module::getExportedModules ( SmallVectorImpl< Module *> &  Exported) const

Appends this module's list of exported modules to Exported.

This provides a subset of immediately imported modules (the ones that are directly exported), not the complete set of exported modules.

Definition at line 280 of file Module.cpp.

◆ getFullModuleName()

std::string Module::getFullModuleName ( bool  AllowStringLiterals = false) const

Retrieve the full name of this module, including the path from its top-level module.

Parameters
AllowStringLiteralsIf true, components that might not be lexically valid as identifiers will be emitted as string literals.

Definition at line 169 of file Module.cpp.

References Parent, printModuleId(), and clang::Result.

Referenced by clang::Sema::ActOnModuleImport(), checkConfigMacro(), clang::Preprocessor::checkModuleIsAvailable(), clang::Sema::CheckRedeclarationModuleOwnership(), collectAllSubModulesWithUmbrellaHeader(), clang::Sema::diagnoseEquivalentInternalLinkageDeclarations(), clang::ModuleMap::diagnoseHeaderInclusion(), getInputBufferForModule(), and clang::Sema::notePreviousDefinition().

◆ getModuleInputBufferName()

static StringRef clang::Module::getModuleInputBufferName ( )
inlinestatic

Definition at line 556 of file Module.h.

Referenced by getInputBufferForModule().

◆ getTopHeaders()

ArrayRef< const FileEntry * > Module::getTopHeaders ( FileManager FileMgr)

The top-level headers associated with this module.

Definition at line 201 of file Module.cpp.

Referenced by getNumberOfModules().

◆ getTopLevelModule() [1/2]

Module* clang::Module::getTopLevelModule ( )
inline

◆ getTopLevelModule() [2/2]

const Module * Module::getTopLevelModule ( ) const

Retrieve the top-level module for this (sub)module, which may be this module.

Definition at line 131 of file Module.cpp.

References Parent, and clang::Result.

◆ getTopLevelModuleName()

StringRef clang::Module::getTopLevelModuleName ( ) const
inline

Retrieve the name of the top-level module.

Definition at line 443 of file Module.h.

References Name.

Referenced by clang::Sema::ActOnModuleImport(), clang::Preprocessor::checkModuleIsAvailable(), compileModuleImpl(), and clang::Preprocessor::LeaveSubmodule().

◆ getUmbrellaDir()

Module::DirectoryName Module::getUmbrellaDir ( ) const

Retrieve the directory for which this module serves as the umbrella.

Definition at line 194 of file Module.cpp.

References clang::Module::DirectoryName::Entry, getUmbrellaHeader(), Umbrella, and UmbrellaAsWritten.

Referenced by collectAllSubModulesWithUmbrellaHeader(), collectModuleHeaderIncludes(), clang::ModuleMap::findModuleForHeader(), and getNumberOfModules().

◆ getUmbrellaHeader()

Header clang::Module::getUmbrellaHeader ( ) const
inline

Retrieve the header that serves as the umbrella header for this module.

Definition at line 465 of file Module.h.

Referenced by collectAllSubModulesWithUmbrellaHeader(), collectModuleHeaderIncludes(), getInputBufferForModule(), getNumberOfModules(), and getUmbrellaDir().

◆ getVisibilityID()

unsigned clang::Module::getVisibilityID ( ) const
inline

Definition at line 533 of file Module.h.

Referenced by clang::VisibleModuleSet::getImportLoc().

◆ hasUmbrellaDir()

bool clang::Module::hasUmbrellaDir ( ) const
inline

Determine whether this module has an umbrella directory that is not based on an umbrella header.

Definition at line 473 of file Module.h.

◆ isAvailable() [1/2]

bool clang::Module::isAvailable ( ) const
inline

Determine whether this module is available for use within the current translation unit.

Definition at line 368 of file Module.h.

Referenced by clang::Preprocessor::checkModuleIsAvailable(), collectModuleHeaderIncludes(), CreateSLocExpansionAbbrev(), and isBetterKnownHeader().

◆ isAvailable() [2/2]

bool Module::isAvailable ( const LangOptions LangOpts,
const TargetInfo Target,
Requirement Req,
UnresolvedHeaderDirective MissingHeader 
) const

Determine whether this module is available for use within the current translation unit.

Parameters
LangOptsThe language options used for the current translation unit.
TargetThe target options used for the current translation unit.
ReqIf this module is unavailable, this parameter will be set to one of the requirements that is not met for use of this module.

Definition at line 96 of file Module.cpp.

References IsAvailable.

◆ isModuleVisible()

bool clang::Module::isModuleVisible ( const Module M) const
inline

Determine whether the specified module would be visible to a lookup at the end of this module.

FIXME: This may return incorrect results for (submodules of) the module currently being built, if it's queried before we see all of its imports.

Definition at line 527 of file Module.h.

◆ isPartOfFramework()

bool clang::Module::isPartOfFramework ( ) const
inline

Determine whether this module is a part of a framework, either because it is a framework module or because it is a submodule of a framework module.

Definition at line 396 of file Module.h.

References Parent.

Referenced by isSubFramework().

◆ isSubFramework()

bool clang::Module::isSubFramework ( ) const
inline

Determine whether this module is a subframework of another framework.

Definition at line 406 of file Module.h.

References isPartOfFramework().

Referenced by inferFrameworkLink().

◆ isSubModule()

bool clang::Module::isSubModule ( ) const
inline

Determine whether this module is a submodule.

Definition at line 387 of file Module.h.

◆ isSubModuleOf()

bool Module::isSubModuleOf ( const Module Other) const

Determine whether this module is a submodule of the given other module.

Definition at line 119 of file Module.cpp.

References Parent.

Referenced by directlyUses().

◆ markUnavailable()

void Module::markUnavailable ( bool  MissingRequirement = false)

Mark this module and all of its submodules as unavailable.

Definition at line 244 of file Module.cpp.

Referenced by addRequirement().

◆ print()

void Module::print ( raw_ostream &  OS,
unsigned  Indent = 0 
) const

Print the module map for this module to the given stream.

Definition at line 360 of file Module.cpp.

Referenced by compileModuleImpl(), dump(), and clang::ModuleMap::dump().

◆ setASTFile()

void clang::Module::setASTFile ( const FileEntry File)
inline

Set the serialized AST file for the top-level module of this module.

Definition at line 453 of file Module.h.

◆ setParent()

void clang::Module::setParent ( Module M)
inline

Set the parent of this module.

This should only be used if the parent could not be set during module creation.

Definition at line 412 of file Module.h.

◆ submodule_begin() [1/2]

submodule_iterator clang::Module::submodule_begin ( )
inline

Definition at line 538 of file Module.h.

Referenced by CreateSLocExpansionAbbrev(), and getNumberOfModules().

◆ submodule_begin() [2/2]

submodule_const_iterator clang::Module::submodule_begin ( ) const
inline

Definition at line 539 of file Module.h.

◆ submodule_end() [1/2]

submodule_iterator clang::Module::submodule_end ( )
inline

Definition at line 540 of file Module.h.

Referenced by CreateSLocExpansionAbbrev(), and getNumberOfModules().

◆ submodule_end() [2/2]

submodule_const_iterator clang::Module::submodule_end ( ) const
inline

Definition at line 541 of file Module.h.

◆ submodules() [1/2]

llvm::iterator_range<submodule_iterator> clang::Module::submodules ( )
inline

Definition at line 543 of file Module.h.

Referenced by collectAllSubModulesWithUmbrellaHeader().

◆ submodules() [2/2]

llvm::iterator_range<submodule_const_iterator> clang::Module::submodules ( ) const
inline

Definition at line 546 of file Module.h.

Member Data Documentation

◆ ConfigMacros

std::vector<std::string> clang::Module::ConfigMacros

The set of "configuration macros", which are macros that (intentionally) change how this module is built.

Definition at line 333 of file Module.h.

◆ ConfigMacrosExhaustive

unsigned clang::Module::ConfigMacrosExhaustive

Whether the set of configuration macros is exhaustive.

When the set of configuration macros is exhaustive, meaning that no identifier not in this list should affect how the module is built.

Definition at line 252 of file Module.h.

Referenced by getNumberOfModules().

◆ Conflicts

std::vector<Conflict> clang::Module::Conflicts

The list of conflicts.

Definition at line 358 of file Module.h.

Referenced by clang::ModuleMap::resolveConflicts().

◆ DefinitionLoc

SourceLocation clang::Module::DefinitionLoc

The location of the module definition.

Definition at line 71 of file Module.h.

Referenced by clang::Preprocessor::checkModuleIsAvailable(), clang::ModuleMap::getContainingModuleMapFile(), and clang::Sema::notePreviousDefinition().

◆ Directory

const DirectoryEntry* clang::Module::Directory = nullptr

The build directory of this module.

This is the directory in which the module is notionally built, and relative to which its headers are found.

Definition at line 96 of file Module.h.

Referenced by clang::ExternalASTSource::ASTSourceDescriptor::ASTSourceDescriptor(), compileModuleImpl(), CreateSLocExpansionAbbrev(), and prepareToBuildModule().

◆ DirectUses

SmallVector<Module *, 2> clang::Module::DirectUses

The directly used modules.

Definition at line 305 of file Module.h.

Referenced by clang::ModuleMap::resolveUses().

◆ ExportAsModule

std::string clang::Module::ExportAsModule

The module through which entities defined in this module will eventually be exposed, for use in "private" modules.

Definition at line 113 of file Module.h.

◆ Exports

SmallVector<ExportDecl, 2> clang::Module::Exports

The set of export declarations.

Definition at line 284 of file Module.h.

Referenced by clang::ModuleMap::resolveExports(), and clang::VisibleModuleSet::setVisible().

◆ HasIncompatibleModuleFile

unsigned clang::Module::HasIncompatibleModuleFile

Whether we tried and failed to load a module file for this module.

Definition at line 204 of file Module.h.

Referenced by clang::CompilerInstance::loadModule().

◆ Headers

SmallVector<Header, 2> clang::Module::Headers[5]

The headers that are part of this module.

Definition at line 168 of file Module.h.

Referenced by clang::ModuleMap::addHeader(), collectModuleHeaderIncludes(), clang::ModuleMap::excludeHeader(), getNumberOfModules(), and violatesPrivateInclude().

◆ Imports

llvm::SmallSetVector<Module *, 2> clang::Module::Imports

The set of modules imported by this module, and on which this module depends.

Definition at line 275 of file Module.h.

Referenced by getNumberOfModules().

◆ InferExplicitSubmodules

unsigned clang::Module::InferExplicitSubmodules

Whether, when inferring submodules, the inferred submodules should be explicit.

Definition at line 241 of file Module.h.

Referenced by clang::ModuleMap::findModuleForHeader(), and getNumberOfModules().

◆ InferExportWildcard

unsigned clang::Module::InferExportWildcard

Whether, when inferring submodules, the inferr submodules should export all modules they import (e.g., the equivalent of "export *").

Definition at line 245 of file Module.h.

Referenced by getNumberOfModules().

◆ InferredSubmoduleLoc

SourceLocation clang::Module::InferredSubmoduleLoc

The location of the inferred submodule.

Definition at line 271 of file Module.h.

◆ InferSubmodules

unsigned clang::Module::InferSubmodules

Whether we should infer submodules for this module based on the headers.

Submodules can only be inferred for modules with an umbrella header.

Definition at line 237 of file Module.h.

Referenced by clang::ModuleMap::findModuleForHeader(), and getNumberOfModules().

◆ IsAvailable

unsigned clang::Module::IsAvailable

Whether this module is available in the current translation unit.

If the module is missing headers or does not meet all requirements then this bit will be 0.

Definition at line 210 of file Module.h.

Referenced by isAvailable().

◆ IsExplicit

unsigned clang::Module::IsExplicit

Whether this is an explicit submodule.

Definition at line 219 of file Module.h.

Referenced by getNumberOfModules().

◆ IsExternC

unsigned clang::Module::IsExternC

Whether this is an 'extern "C"' module (which implicitly puts all headers in it within an 'extern "C"' block, and allows the module to be imported within such a block).

Definition at line 228 of file Module.h.

Referenced by collectModuleHeaderIncludes(), getInputBufferForModule(), and getNumberOfModules().

◆ IsFramework

unsigned clang::Module::IsFramework

Whether this is a framework module.

Definition at line 216 of file Module.h.

Referenced by appendSubframeworkPaths(), clang::ModuleMap::diagnoseHeaderInclusion(), getNumberOfModules(), and inferFrameworkLink().

◆ IsFromModuleFile

unsigned clang::Module::IsFromModuleFile

Whether this module was loaded from a module file.

Definition at line 213 of file Module.h.

◆ IsInferred

unsigned clang::Module::IsInferred

Whether this is an inferred submodule (module * { ... }).

Definition at line 231 of file Module.h.

Referenced by clang::ModuleMap::getModuleMapFileForUniquing(), prepareToBuildModule(), and clang::ModuleMap::setInferredModuleAllowedBy().

◆ IsMissingRequirement

unsigned clang::Module::IsMissingRequirement

Whether this module is missing a feature from Requirements.

Definition at line 201 of file Module.h.

◆ IsSystem

unsigned clang::Module::IsSystem

Whether this is a "system" module (which assumes that all headers in it are system headers).

Definition at line 223 of file Module.h.

Referenced by compileModuleImpl(), getNumberOfModules(), clang::ModuleMap::inferFrameworkModule(), and clang::Preprocessor::LookupFile().

◆ Kind

ModuleKind clang::Module::Kind = ModuleMapModule

The kind of this module.

Definition at line 87 of file Module.h.

Referenced by clang::Sema::CheckRedeclarationModuleOwnership(), getNumberOfModules(), and clang::Decl::getOwningModuleForLinkage().

◆ LinkLibraries

llvm::SmallVector<LinkLibrary, 2> clang::Module::LinkLibraries

The set of libraries or frameworks to link against when an entity from this module is used.

Definition at line 329 of file Module.h.

Referenced by inferFrameworkLink().

◆ MissingHeaders

SmallVector<UnresolvedHeaderDirective, 1> clang::Module::MissingHeaders

Headers that are mentioned in the module map file but could not be found on the file system.

Definition at line 188 of file Module.h.

Referenced by collectModuleHeaderIncludes(), and CreateSLocExpansionAbbrev().

◆ Name

std::string clang::Module::Name

◆ NameVisibility

NameVisibilityKind clang::Module::NameVisibility

The visibility of names within this particular module.

Definition at line 268 of file Module.h.

Referenced by clang::ASTReader::makeNamesVisible(), and clang::ASTDeclReader::UpdateDecl().

◆ NoUndeclaredIncludes

unsigned clang::Module::NoUndeclaredIncludes

Whether files in this module can only include non-modular headers and headers from used modules.

Definition at line 256 of file Module.h.

Referenced by needModuleLookup(), and suggestModule().

◆ NumHeaderKinds

const int clang::Module::NumHeaderKinds = HK_Excluded + 1
static

Definition at line 147 of file Module.h.

◆ Parent

Module* clang::Module::Parent

◆ PresumedModuleMapFile

std::string clang::Module::PresumedModuleMapFile

The presumed file name for the module map defining this module.

Only non-empty when building from preprocessed source.

Definition at line 100 of file Module.h.

◆ Requirements

SmallVector<Requirement, 2> clang::Module::Requirements

The set of language features required to use this module.

If any of these requirements are not available, the IsAvailable bit will be false to indicate that this (sub)module is not available.

Definition at line 198 of file Module.h.

Referenced by addRequirement(), and getNumberOfModules().

◆ Signature

ASTFileSignature clang::Module::Signature

The module signature.

Definition at line 106 of file Module.h.

◆ Umbrella

llvm::PointerUnion<const DirectoryEntry *, const FileEntry *> clang::Module::Umbrella

The umbrella header or directory.

Definition at line 103 of file Module.h.

Referenced by getUmbrellaDir(), clang::ModuleMap::setUmbrellaDir(), and clang::ModuleMap::setUmbrellaHeader().

◆ UmbrellaAsWritten

std::string clang::Module::UmbrellaAsWritten

The name of the umbrella entry, as written in the module map.

Definition at line 109 of file Module.h.

Referenced by getUmbrellaDir(), clang::ModuleMap::setUmbrellaDir(), and clang::ModuleMap::setUmbrellaHeader().

◆ UnresolvedConflicts

std::vector<UnresolvedConflict> clang::Module::UnresolvedConflicts

The list of conflicts for which the module-id has not yet been resolved.

Definition at line 346 of file Module.h.

Referenced by clang::ModuleMap::resolveConflicts().

◆ UnresolvedDirectUses

SmallVector<ModuleId, 2> clang::Module::UnresolvedDirectUses

The set of use declarations that have yet to be resolved.

Definition at line 308 of file Module.h.

Referenced by clang::ModuleMap::resolveUses().

◆ UnresolvedExports

SmallVector<UnresolvedExportDecl, 2> clang::Module::UnresolvedExports

The set of export declarations that have yet to be resolved.

Definition at line 302 of file Module.h.

Referenced by clang::ModuleMap::resolveExports().

◆ UnresolvedHeaders

SmallVector<UnresolvedHeaderDirective, 1> clang::Module::UnresolvedHeaders

Headers that are mentioned in the module map file but that we have not yet attempted to resolve to a file on the file system.

Definition at line 184 of file Module.h.

Referenced by clang::ModuleMap::resolveHeaderDirectives(), and clang::ModuleMap::setUmbrellaDir().


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