clang
15.0.0git
|
Describes a module or submodule. More...
#include "clang/Basic/Module.h"
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, ModuleHeaderUnit, ModulePartitionInterface, ModulePartitionImplementation, GlobalModuleFragment, PrivateModuleFragment } |
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 | |
bool | isModulePurview () const |
Does this Module scope describe part of the purview of a named C++ module? More... | |
bool | isGlobalModule () const |
Does this Module scope describe a fragment of the global module within some C++ module. More... | |
bool | isPrivateModule () const |
bool | isModuleMapModule () const |
Module (StringRef Name, SourceLocation DefinitionLoc, Module *Parent, bool IsFramework, bool IsExplicit, unsigned VisibilityID) | |
Construct a new module or submodule. More... | |
~Module () | |
bool | isUnimportable () const |
Determine whether this module has been declared unimportable. More... | |
bool | isUnimportable (const LangOptions &LangOpts, const TargetInfo &Target, Requirement &Req, Module *&ShadowingModule) const |
Determine whether this module has been declared unimportable. More... | |
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, Module *&ShadowingModule) 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 |
Check if this module is a (possibly transitive) submodule of Other . 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... | |
bool | isModulePartition () const |
Is this a module partition. More... | |
bool | isHeaderUnit () const |
Is this module a header unit. More... | |
bool | isInterfaceOrPartition () const |
bool | isModuleInterfaceUnit () const |
StringRef | getPrimaryModuleInterfaceName () const |
Get the primary module interface name from a partition. 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... | |
Module * | getTopLevelModule () |
Retrieve the top-level module for this (sub)module, which may be this module. More... | |
const Module * | getTopLevelModule () 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... | |
OptionalFileEntryRefDegradesToFileEntryPtr | getASTFile () const |
The serialized AST file for this module, if one was created. More... | |
void | setASTFile (Optional< FileEntryRef > 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) |
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 Unimportable) |
Mark this module and all of its submodules as unavailable. More... | |
Module * | findSubmodule (StringRef Name) const |
Find the submodule with the given name. More... | |
Module * | findOrInferSubmodule (StringRef Name) |
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_iterator > | submodules () |
llvm::iterator_range< submodule_const_iterator > | submodules () 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, bool Dump=false) 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... | |
Module * | Parent |
The parent of this module. More... | |
const DirectoryEntry * | Directory = 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 FileEntry *, const DirectoryEntry * > | 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 | UmbrellaRelativeToRootModuleDirectory |
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... | |
Module * | ShadowingModule = nullptr |
A module with the same name that shadows this module. More... | |
unsigned | IsUnimportable: 1 |
Whether this module has declared itself unimportable, either because it's missing a requirement from Requirements or because it's been shadowed by another module. 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... | |
unsigned | ModuleMapIsPrivate: 1 |
Whether this module came from a "private" module map, found next to a regular (public) module map. 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::SmallSetVector< const Module *, 2 > | UndeclaredUses |
When NoUndeclaredIncludes is true, the set of modules this module tried to import but didn't because they are not direct uses. More... | |
llvm::SmallVector< LinkLibrary, 2 > | LinkLibraries |
The set of libraries or frameworks to link against when an entity from this module is used. More... | |
bool | UseExportAsModuleLinkName = false |
Autolinking uses the framework name for linking purposes when this is false and the export_as name otherwise. 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< UnresolvedConflict > | UnresolvedConflicts |
The list of conflicts for which the module-id has not yet been resolved. More... | |
std::vector< Conflict > | Conflicts |
The list of conflicts. More... | |
Static Public Attributes | |
static const int | NumHeaderKinds = HK_Excluded + 1 |
using clang::Module::ExportDecl = llvm::PointerIntPair<Module *, 1, bool> |
using clang::Module::Requirement = std::pair<std::string, bool> |
using clang::Module::submodule_const_iterator = std::vector<Module *>::const_iterator |
using clang::Module::submodule_iterator = std::vector<Module *>::iterator |
Module::Module | ( | StringRef | Name, |
SourceLocation | DefinitionLoc, | ||
Module * | Parent, | ||
bool | IsFramework, | ||
bool | IsExplicit, | ||
unsigned | VisibilityID | ||
) |
Construct a new module or submodule.
Definition at line 37 of file Module.cpp.
Referenced by clang::Sema::ActOnModuleDecl(), and clang::Sema::ActOnModuleImport().
Module::~Module | ( | ) |
Definition at line 61 of file Module.cpp.
References submodule_begin(), and submodule_end().
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.
Feature | The feature that is required by this module (and its submodules). |
RequiredState | The required state of this feature: true if it must be present, false if it must be absent. |
LangOpts | The set of language options that will be used to evaluate the availability of this feature. |
Target | The target options that will be used to evaluate the availability of this feature. |
Definition at line 291 of file Module.cpp.
void Module::addTopHeader | ( | const FileEntry * | File | ) |
Add a top-level header associated with this module.
Definition at line 252 of file Module.cpp.
References clang::File.
|
inline |
Determine whether this module has declared its intention to directly use another module.
Definition at line 270 of file Module.cpp.
References getTopLevelModule(), isSubModuleOf(), Name, NoUndeclaredIncludes, Parent, and UndeclaredUses.
Referenced by clang::ModuleMap::diagnoseHeaderInclusion(), and suggestModule().
LLVM_DUMP_METHOD void Module::dump | ( | ) | const |
Dump the contents of this module to the given output stream.
Definition at line 577 of file APINotesYAMLCompiler.cpp.
Module * Module::findOrInferSubmodule | ( | StringRef | Name | ) |
Definition at line 339 of file Module.cpp.
Module * Module::findSubmodule | ( | StringRef | Name | ) | const |
Find the submodule with the given name.
Definition at line 331 of file Module.cpp.
Whether the full name of this module is equal to joining nameParts
with "."s.
This is more efficient than getFullModuleName().
Definition at line 235 of file Module.cpp.
References Parent.
Referenced by shouldAddRequirement().
|
inline |
The serialized AST file for this module, if one was created.
Definition at line 596 of file Module.h.
References getTopLevelModule().
Referenced by clang::ASTSourceDescriptor::ASTSourceDescriptor(), clang::CompilerInstance::loadGlobalModuleIndex(), and setASTFile().
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 354 of file Module.cpp.
References Exports, Imports, IsExplicit, and isSubModuleOf().
std::string Module::getFullModuleName | ( | bool | AllowStringLiterals = false | ) | const |
Retrieve the full name of this module, including the path from its top-level module.
AllowStringLiterals | If true , components that might not be lexically valid as identifiers will be emitted as string literals. |
Definition at line 219 of file Module.cpp.
References Parent, and string().
Referenced by clang::Sema::ActOnModuleImport(), checkConfigMacro(), clang::Sema::CheckRedeclarationModuleOwnership(), clang::Sema::diagnoseEquivalentInternalLinkageDeclarations(), clang::ModuleMap::diagnoseHeaderInclusion(), clang::Sema::diagnoseMissingImport(), getInputBufferForModule(), clang::Sema::notePreviousDefinition(), and clang::TextNodeDumper::VisitImportDecl().
|
inlinestatic |
Definition at line 703 of file Module.h.
Referenced by getInputBufferForModule().
|
inline |
Get the primary module interface name from a partition.
Definition at line 546 of file Module.h.
References getTopLevelModuleName(), isGlobalModule(), isModulePartition(), isPrivateModule(), and Name.
Referenced by clang::Sema::ActOnModuleImport().
ArrayRef< const FileEntry * > Module::getTopHeaders | ( | FileManager & | FileMgr | ) |
The top-level headers associated with this module.
Definition at line 257 of file Module.cpp.
References clang::FileManager::getFile().
|
inline |
Retrieve the top-level module for this (sub)module, which may be this module.
Definition at line 581 of file Module.h.
Referenced by clang::ModuleMap::addHeader(), clang::ModuleMap::diagnoseHeaderInclusion(), directlyUses(), clang::ModuleMap::findModuleForHeader(), getASTFile(), clang::ASTWriter::getLocalOrImportedSubmoduleID(), getTopLevelModuleName(), getTopLevelOrNull(), clang::ModuleMap::KnownHeader::isAccessibleFrom(), isForModuleBuilding(), and setASTFile().
const Module* clang::Module::getTopLevelModule | ( | ) | const |
Retrieve the top-level module for this (sub)module, which may be this module.
|
inline |
Retrieve the name of the top-level module.
Definition at line 591 of file Module.h.
References getTopLevelModule(), and Name.
Referenced by clang::Sema::ActOnModuleImport(), compileModule(), getPrimaryModuleInterfaceName(), isForModuleBuilding(), and clang::Preprocessor::LeaveSubmodule().
Module::DirectoryName Module::getUmbrellaDir | ( | ) | const |
Retrieve the directory for which this module serves as the umbrella.
Definition at line 244 of file Module.cpp.
References getUmbrellaHeader(), Umbrella, UmbrellaAsWritten, and UmbrellaRelativeToRootModuleDirectory.
Referenced by clang::ModuleMap::isHeaderUnavailableInModule(), and print().
|
inline |
Retrieve the header that serves as the umbrella header for this module.
Definition at line 613 of file Module.h.
References Umbrella, UmbrellaAsWritten, and UmbrellaRelativeToRootModuleDirectory.
Referenced by collectAllSubModulesWithUmbrellaHeader(), getInputBufferForModule(), getUmbrellaDir(), and print().
|
inline |
Definition at line 680 of file Module.h.
Referenced by clang::VisibleModuleSet::getImportLoc().
|
inline |
|
inline |
Determine whether this module is available for use within the current translation unit.
Definition at line 466 of file Module.h.
References IsAvailable.
Referenced by clang::ModuleMap::KnownHeader::isAvailable(), isBetterKnownHeader(), and clang::ModuleMap::isHeaderUnavailableInModule().
bool Module::isAvailable | ( | const LangOptions & | LangOpts, |
const TargetInfo & | Target, | ||
Requirement & | Req, | ||
UnresolvedHeaderDirective & | MissingHeader, | ||
Module *& | ShadowingModule | ||
) | const |
Determine whether this module is available for use within the current translation unit.
LangOpts | The language options used for the current translation unit. |
Target | The target options used for the current translation unit. |
Req | If this module is unavailable because of a missing requirement, this parameter will be set to one of the requirements that is not met for use of this module. |
MissingHeader | If this module is unavailable because of a missing header, this parameter will be set to one of the missing headers. |
ShadowingModule | If this module is unavailable because it is shadowed, this parameter will be set to the shadowing module. |
Definition at line 151 of file Module.cpp.
|
inline |
Does this Module scope describe a fragment of the global module within some C++ module.
Definition at line 169 of file Module.h.
References GlobalModuleFragment, and Kind.
Referenced by getPrimaryModuleInterfaceName(), and clang::Sema::isModuleVisible().
|
inline |
Is this module a header unit.
Definition at line 535 of file Module.h.
References Kind, and ModuleHeaderUnit.
|
inline |
Definition at line 537 of file Module.h.
References isModulePartition(), Kind, and ModuleInterfaceUnit.
|
inline |
Definition at line 541 of file Module.h.
References Kind, ModuleInterfaceUnit, and ModulePartitionInterface.
|
inline |
Definition at line 173 of file Module.h.
References Kind, and ModuleMapModule.
|
inline |
Is this a module partition.
Definition at line 529 of file Module.h.
References Kind, ModulePartitionImplementation, and ModulePartitionInterface.
Referenced by getPrimaryModuleInterfaceName(), and isInterfaceOrPartition().
|
inline |
Does this Module scope describe part of the purview of a named C++ module?
Definition at line 161 of file Module.h.
References Kind, ModuleInterfaceUnit, ModulePartitionImplementation, ModulePartitionInterface, and PrivateModuleFragment.
Referenced by clang::Sema::CheckRedeclarationModuleOwnership().
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 674 of file Module.h.
Referenced by clang::Sema::isModuleVisible().
|
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 505 of file Module.h.
References Parent.
Referenced by isSubFramework().
|
inline |
Definition at line 171 of file Module.h.
References Kind, and PrivateModuleFragment.
Referenced by getPrimaryModuleInterfaceName().
|
inline |
Determine whether this module is a subframework of another framework.
Definition at line 515 of file Module.h.
References IsFramework, isPartOfFramework(), and Parent.
Referenced by inferFrameworkLink().
|
inline |
Check if this module is a (possibly transitive) submodule of Other
.
The 'A is a submodule of B' relation is a partial order based on the the parent-child relationship between individual modules.
Returns false
if Other
is nullptr
.
Definition at line 173 of file Module.cpp.
References Parent.
Referenced by directlyUses(), getExportedModules(), and clang::ModuleMap::isHeaderUnavailableInModule().
|
inline |
Determine whether this module has been declared unimportable.
Definition at line 446 of file Module.h.
References IsUnimportable.
bool Module::isUnimportable | ( | const LangOptions & | LangOpts, |
const TargetInfo & | Target, | ||
Requirement & | Req, | ||
Module *& | ShadowingModule | ||
) | const |
Determine whether this module has been declared unimportable.
LangOpts | The language options used for the current translation unit. |
Target | The target options used for the current translation unit. |
Req | If this module is unimportable because of a missing requirement, this parameter will be set to one of the requirements that is not met for use of this module. |
ShadowingModule | If this module is unimportable because it is shadowed, this parameter will be set to the shadowing module. |
Definition at line 128 of file Module.cpp.
void Module::markUnavailable | ( | bool | Unimportable | ) |
Mark this module and all of its submodules as unavailable.
Definition at line 303 of file Module.cpp.
Print the module map for this module to the given stream.
Definition at line 434 of file Module.cpp.
References ConfigMacros, ConfigMacrosExhaustive, Conflicts, DirectUses, ExportAsModule, Exports, getUmbrellaDir(), getUmbrellaHeader(), Headers, HK_Excluded, HK_Normal, HK_Private, HK_PrivateTextual, HK_Textual, Id, Imports, clang::Indent(), InferExplicitSubmodules, InferExportWildcard, InferSubmodules, IsExplicit, IsExternC, IsFramework, IsSystem, Kind, clang::Library, LinkLibraries, MissingHeaders, Name, printModuleId(), Requirements, submodule_begin(), submodule_end(), clang::Unresolved, UnresolvedConflicts, UnresolvedDirectUses, UnresolvedExports, and UnresolvedHeaders.
Referenced by clang::RewriteIncludesAction::BeginSourceFileAction(), compileModule(), clang::ModuleMap::dump(), clang::PrintPreprocessedAction::ExecuteAction(), and runThinLTOBackend().
|
inline |
Set the serialized AST file for the top-level module of this module.
Definition at line 601 of file Module.h.
References clang::File, getASTFile(), and getTopLevelModule().
|
inline |
|
inline |
Definition at line 685 of file Module.h.
Referenced by forEachSubmoduleSorted(), getNumberOfModules(), print(), submodules(), and ~Module().
|
inline |
|
inline |
Definition at line 687 of file Module.h.
Referenced by forEachSubmoduleSorted(), getNumberOfModules(), print(), submodules(), and ~Module().
|
inline |
|
inline |
Definition at line 690 of file Module.h.
References submodule_begin(), and submodule_end().
Referenced by collectAllSubModulesWithUmbrellaHeader().
|
inline |
Definition at line 693 of file Module.h.
References submodule_begin(), and submodule_end().
std::vector<std::string> clang::Module::ConfigMacros |
unsigned clang::Module::ConfigMacrosExhaustive |
std::vector<Conflict> clang::Module::Conflicts |
The list of conflicts.
Definition at line 437 of file Module.h.
Referenced by print(), and clang::ModuleMap::resolveConflicts().
SourceLocation clang::Module::DefinitionLoc |
The location of the module definition.
Definition at line 102 of file Module.h.
Referenced by clang::ModuleMap::getContainingModuleMapFile(), clang::CompilerInstance::loadGlobalModuleIndex(), and clang::Sema::notePreviousDefinition().
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 138 of file Module.h.
Referenced by clang::ASTSourceDescriptor::ASTSourceDescriptor(), compileModule(), and prepareToBuildModule().
SmallVector<Module *, 2> clang::Module::DirectUses |
The directly used modules.
Definition at line 376 of file Module.h.
Referenced by print(), and clang::ModuleMap::resolveUses().
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 158 of file Module.h.
Referenced by clang::ModuleMap::addLinkAsDependency(), and print().
SmallVector<ExportDecl, 2> clang::Module::Exports |
The set of export declarations.
Definition at line 355 of file Module.h.
Referenced by getExportedModules(), print(), and clang::ModuleMap::resolveExports().
unsigned clang::Module::HasIncompatibleModuleFile |
SmallVector<Header, 2> clang::Module::Headers[5] |
The headers that are part of this module.
Definition at line 230 of file Module.h.
Referenced by clang::ModuleMap::addHeader(), clang::ModuleMap::excludeHeader(), print(), and violatesPrivateInclude().
llvm::SmallSetVector<Module *, 2> clang::Module::Imports |
The set of modules imported by this module, and on which this module depends.
Definition at line 346 of file Module.h.
Referenced by addLinkOptionsPostorder(), getExportedModules(), and print().
unsigned clang::Module::InferExplicitSubmodules |
unsigned clang::Module::InferExportWildcard |
SourceLocation clang::Module::InferredSubmoduleLoc |
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 304 of file Module.h.
Referenced by clang::ModuleMap::isHeaderUnavailableInModule(), and print().
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 277 of file Module.h.
Referenced by isAvailable().
unsigned clang::Module::IsExplicit |
Whether this is an explicit submodule.
Definition at line 286 of file Module.h.
Referenced by getExportedModules(), and print().
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 295 of file Module.h.
Referenced by getInputBufferForModule(), and print().
unsigned clang::Module::IsFramework |
Whether this is a framework module.
Definition at line 283 of file Module.h.
Referenced by clang::ModuleMap::diagnoseHeaderInclusion(), inferFrameworkLink(), isForModuleBuilding(), isSubFramework(), and print().
unsigned clang::Module::IsFromModuleFile |
unsigned clang::Module::IsInferred |
Whether this is an inferred submodule (module * { ... }).
Definition at line 298 of file Module.h.
Referenced by clang::ModuleMap::getModuleMapFileForUniquing(), prepareToBuildModule(), and clang::ModuleMap::setInferredModuleAllowedBy().
unsigned clang::Module::IsSystem |
Whether this is a "system" module (which assumes that all headers in it are system headers).
Definition at line 290 of file Module.h.
Referenced by compileModule(), clang::ModuleMap::inferFrameworkModule(), clang::Preprocessor::LookupFile(), print(), and clang::PCHValidator::ReadDiagnosticOptions().
unsigned clang::Module::IsUnimportable |
Whether this module has declared itself unimportable, either because it's missing a requirement from Requirements
or because it's been shadowed by another module.
Definition at line 268 of file Module.h.
Referenced by isUnimportable().
ModuleKind clang::Module::Kind = ModuleMapModule |
The kind of this module.
Definition at line 129 of file Module.h.
Referenced by clang::Sema::ActOnModuleDecl(), clang::Sema::ActOnModuleImport(), clang::Sema::CheckRedeclarationModuleOwnership(), clang::Sema::diagnoseMissingImport(), clang::Decl::getOwningModuleForLinkage(), isGlobalModule(), isHeaderUnit(), isInterfaceOrPartition(), isModuleInterfaceUnit(), isModuleMapModule(), isModulePartition(), isModulePurview(), isPrivateModule(), and print().
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 404 of file Module.h.
Referenced by addLinkOptionsPostorder(), inferFrameworkLink(), and print().
SmallVector<UnresolvedHeaderDirective, 1> clang::Module::MissingHeaders |
unsigned clang::Module::ModuleMapIsPrivate |
std::string clang::Module::Name |
The name of this module.
Definition at line 99 of file Module.h.
Referenced by clang::ModuleMap::addLinkAsDependency(), compileModuleAndReadASTBehindLock(), compileModuleAndReadASTImpl(), clang::ModuleMap::diagnoseHeaderInclusion(), directlyUses(), forEachSubmoduleSorted(), clang::index::generateFullUSRForModule(), clang::index::generateUSRFragmentForModule(), clang::HeaderSearch::getCachedModuleFileName(), clang::ASTSourceDescriptor::getModuleName(), clang::HeaderSearch::getPrebuiltImplicitModuleFileName(), getPrimaryModuleInterfaceName(), getTopLevelModuleName(), inferFrameworkLink(), clang::CompilerInstance::loadGlobalModuleIndex(), llvm::yaml::MappingTraits< Module >::mapping(), print(), readASTAfterCompileModule(), clang::ModuleMap::resolveLinkAsDependencies(), and setParent().
NameVisibilityKind clang::Module::NameVisibility |
The visibility of names within this particular module.
Definition at line 339 of file Module.h.
Referenced by clang::ASTReader::makeNamesVisible().
unsigned clang::Module::NoUndeclaredIncludes |
Whether files in this module can only include non-modular headers and headers from used modules.
Definition at line 323 of file Module.h.
Referenced by directlyUses(), needModuleLookup(), and suggestModule().
|
static |
Module* clang::Module::Parent |
The parent of this module.
This will be NULL for the top-level module.
Definition at line 133 of file Module.h.
Referenced by clang::Sema::ActOnModuleImport(), addLinkOptionsPostorder(), clang::Sema::CheckRedeclarationModuleOwnership(), directlyUses(), fullModuleNameIs(), clang::index::generateFullUSRForModule(), getFullModuleName(), clang::Decl::getOwningModuleForLinkage(), clang::index::IndexingContext::importedModule(), clang::ModuleMap::isHeaderUnavailableInModule(), isPartOfFramework(), isSubFramework(), isSubModule(), isSubModuleOf(), clang::ModuleMap::mayShadowNewModule(), reportModuleReferences(), and setParent().
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 142 of file Module.h.
Referenced by clang::FrontendAction::BeginSourceFile().
SmallVector<Requirement, 2> clang::Module::Requirements |
Module* clang::Module::ShadowingModule = nullptr |
ASTFileSignature clang::Module::Signature |
llvm::PointerUnion<const FileEntry *, const DirectoryEntry *> clang::Module::Umbrella |
The umbrella header or directory.
Definition at line 145 of file Module.h.
Referenced by getUmbrellaDir(), getUmbrellaHeader(), hasUmbrellaDir(), clang::ModuleMap::setUmbrellaDir(), and clang::ModuleMap::setUmbrellaHeader().
std::string clang::Module::UmbrellaAsWritten |
The name of the umbrella entry, as written in the module map.
Definition at line 151 of file Module.h.
Referenced by getUmbrellaDir(), getUmbrellaHeader(), clang::ModuleMap::setUmbrellaDir(), and clang::ModuleMap::setUmbrellaHeader().
std::string clang::Module::UmbrellaRelativeToRootModuleDirectory |
Definition at line 154 of file Module.h.
Referenced by getUmbrellaDir(), getUmbrellaHeader(), clang::ModuleMap::setUmbrellaDir(), and clang::ModuleMap::setUmbrellaHeader().
llvm::SmallSetVector<const Module *, 2> clang::Module::UndeclaredUses |
When NoUndeclaredIncludes
is true, the set of modules this module tried to import but didn't because they are not direct uses.
Definition at line 383 of file Module.h.
Referenced by directlyUses().
std::vector<UnresolvedConflict> clang::Module::UnresolvedConflicts |
The list of conflicts for which the module-id has not yet been resolved.
Definition at line 425 of file Module.h.
Referenced by print(), and clang::ModuleMap::resolveConflicts().
SmallVector<ModuleId, 2> clang::Module::UnresolvedDirectUses |
The set of use declarations that have yet to be resolved.
Definition at line 379 of file Module.h.
Referenced by print(), and clang::ModuleMap::resolveUses().
SmallVector<UnresolvedExportDecl, 2> clang::Module::UnresolvedExports |
The set of export declarations that have yet to be resolved.
Definition at line 373 of file Module.h.
Referenced by print(), and clang::ModuleMap::resolveExports().
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 246 of file Module.h.
Referenced by print(), and clang::ModuleMap::resolveHeaderDirectives().
Autolinking uses the framework name for linking purposes when this is false and the export_as name otherwise.
Definition at line 408 of file Module.h.
Referenced by clang::ModuleMap::addLinkAsDependency(), and addLinkOptionsPostorder().