clang API Documentation
Describes a module or submodule. More...
#include <Module.h>

Classes | |
| struct | UnresolvedExportDecl |
| Describes an exported module that has not yet been resolved (perhaps because tASThe module it refers to has not yet been loaded). More... | |
Public Types | |
| enum | NameVisibilityKind { Hidden, MacrosVisible, AllVisible } |
| Describes the visibility of the various names within a particular module. More... | |
| typedef llvm::PointerIntPair < Module *, 1, bool > | ExportDecl |
| Describes an exported module. | |
| typedef std::vector< Module * > ::iterator | submodule_iterator |
| typedef std::vector< Module * > ::const_iterator | submodule_const_iterator |
Public Member Functions | |
| Module (StringRef Name, SourceLocation DefinitionLoc, bool IsFramework) | |
| Construct a top-level module. | |
| Module (StringRef Name, SourceLocation DefinitionLoc, Module *Parent, bool IsFramework, bool IsExplicit) | |
| Construct a new module or submodule. | |
| ~Module () | |
| bool | isAvailable () const |
| Determine whether this module is available for use within the current translation unit. | |
| bool | isAvailable (const LangOptions &LangOpts, const TargetInfo &Target, StringRef &Feature) const |
| Determine whether this module is available for use within the current translation unit. | |
| bool | isSubModule () const |
| Determine whether this module is a submodule. | |
| bool | isSubModuleOf (Module *Other) const |
| Determine whether this module is a submodule of the given other module. | |
| 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. | |
| std::string | getFullModuleName () const |
| Retrieve the full name of this module, including the path from its top-level module. | |
| Module * | getTopLevelModule () |
| Retrieve the top-level module for this (sub)module, which may be this module. | |
| const Module * | getTopLevelModule () const |
| Retrieve the top-level module for this (sub)module, which may be this module. | |
| StringRef | getTopLevelModuleName () const |
| Retrieve the name of the top-level module. | |
| const DirectoryEntry * | getUmbrellaDir () const |
| Retrieve the directory for which this module serves as the umbrella. | |
| const FileEntry * | getUmbrellaHeader () const |
| Retrieve the header that serves as the umbrella header for this module. | |
| bool | hasUmbrellaDir () const |
| Determine whether this module has an umbrella directory that is not based on an umbrella header. | |
| void | addRequirement (StringRef Feature, const LangOptions &LangOpts, const TargetInfo &Target) |
| Module * | findSubmodule (StringRef Name) const |
| Find the submodule with the given name. | |
| submodule_iterator | submodule_begin () |
| submodule_const_iterator | submodule_begin () const |
| submodule_iterator | submodule_end () |
| submodule_const_iterator | submodule_end () const |
| void | print (llvm::raw_ostream &OS, unsigned Indent=0) const |
| Print the module map for this module to the given stream. | |
| void | dump () const |
| Dump the contents of this module to the given output stream. | |
Public Attributes | |
| std::string | Name |
| The name of this module. | |
| SourceLocation | DefinitionLoc |
| The location of the module definition. | |
| Module * | Parent |
| The parent of this module. This will be NULL for the top-level module. | |
| llvm::PointerUnion< const DirectoryEntry *, const FileEntry * > | Umbrella |
| The umbrella header or directory. | |
| llvm::SmallVector< const FileEntry *, 2 > | Headers |
| The headers that are part of this module. | |
| llvm::SmallVector< std::string, 2 > | Requires |
| The set of language features required to use this module. | |
| unsigned | IsAvailable: 1 |
| Whether this module is available in the current translation unit. | |
| unsigned | IsFromModuleFile: 1 |
| Whether this module was loaded from a module file. | |
| unsigned | IsFramework: 1 |
| Whether this is a framework module. | |
| unsigned | IsExplicit: 1 |
| Whether this is an explicit submodule. | |
| unsigned | IsSystem: 1 |
| Whether this is a "system" module (which assumes that all headers in it are system headers). | |
| unsigned | InferSubmodules: 1 |
| Whether we should infer submodules for this module based on the headers. | |
| unsigned | InferExplicitSubmodules: 1 |
| Whether, when inferring submodules, the inferred submodules should be explicit. | |
| unsigned | InferExportWildcard: 1 |
| Whether, when inferring submodules, the inferr submodules should export all modules they import (e.g., the equivalent of "export *"). | |
| NameVisibilityKind | NameVisibility |
| \ brief The visibility of names within this particular module. | |
| SourceLocation | InferredSubmoduleLoc |
| The location of the inferred submodule. | |
| llvm::SmallVector< Module *, 2 > | Imports |
| The set of modules imported by this module, and on which this module depends. | |
| llvm::SmallVector< ExportDecl, 2 > | Exports |
| The set of export declarations. | |
| llvm::SmallVector < UnresolvedExportDecl, 2 > | UnresolvedExports |
| The set of export declarations that have yet to be resolved. | |
Describes a module or submodule.
Definition at line 43 of file Basic/Module.h.
| typedef llvm::PointerIntPair<Module *, 1, bool> clang::Module::ExportDecl |
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 134 of file Basic/Module.h.
| typedef std::vector<Module *>::const_iterator clang::Module::submodule_const_iterator |
Definition at line 266 of file Basic/Module.h.
| typedef std::vector<Module *>::iterator clang::Module::submodule_iterator |
Definition at line 265 of file Basic/Module.h.
Describes the visibility of the various names within a particular module.
| Hidden |
All of the names in this module are hidden. |
| MacrosVisible |
Only the macro names in this module are visible. |
| AllVisible |
All of the names in this module are visible. |
Definition at line 110 of file Basic/Module.h.
| clang::Module::Module | ( | StringRef | Name, |
| SourceLocation | DefinitionLoc, | ||
| bool | IsFramework | ||
| ) | [inline, explicit] |
Construct a top-level module.
Definition at line 158 of file Basic/Module.h.
| Module::Module | ( | StringRef | Name, |
| SourceLocation | DefinitionLoc, | ||
| Module * | Parent, | ||
| bool | IsFramework, | ||
| bool | IsExplicit | ||
| ) |
Construct a new module or submodule.
Definition at line 24 of file Basic/Module.cpp.
References IsAvailable, isAvailable(), IsSystem, and Name.
| Module::~Module | ( | ) |
Definition at line 43 of file Basic/Module.cpp.
References submodule_begin(), and submodule_end().
| void Module::addRequirement | ( | StringRef | Feature, |
| 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). |
| 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 132 of file Basic/Module.cpp.
References hasFeature(), IsAvailable, Requires, submodule_begin(), and submodule_end().
| void Module::dump | ( | ) | const |
Dump the contents of this module to the given output stream.
Definition at line 270 of file Basic/Module.cpp.
References print().
| Module * Module::findSubmodule | ( | StringRef | Name | ) | const |
Find the submodule with the given name.
Definition at line 162 of file Basic/Module.cpp.
Referenced by clang::CompilerInstance::loadModule(), and clang::ModuleMap::lookupModuleQualified().
| std::string Module::getFullModuleName | ( | ) | const |
Retrieve the full name of this module, including the path from its top-level module.
Definition at line 105 of file Basic/Module.cpp.
References Parent.
Referenced by clang::GenerateModuleAction::BeginSourceFileAction(), and clang::CompilerInstance::loadModule().
| Module* clang::Module::getTopLevelModule | ( | ) | [inline] |
Retrieve the top-level module for this (sub)module, which may be this module.
Definition at line 215 of file Basic/Module.h.
Referenced by clang::HeaderSearch::getModuleFileName(), and getTopLevelModuleName().
| const Module * Module::getTopLevelModule | ( | ) | const |
Retrieve the top-level module for this (sub)module, which may be this module.
Definition at line 97 of file Basic/Module.cpp.
References Parent.
| StringRef clang::Module::getTopLevelModuleName | ( | ) | const [inline] |
Retrieve the name of the top-level module.
Definition at line 226 of file Basic/Module.h.
References getTopLevelModule(), and Name.
Referenced by compileModule().
| const DirectoryEntry * Module::getUmbrellaDir | ( | ) | const |
Retrieve the directory for which this module serves as the umbrella.
Definition at line 125 of file Basic/Module.cpp.
References getUmbrellaHeader(), and Umbrella.
Referenced by collectModuleHeaderIncludes(), clang::ModuleMap::findModuleForHeader(), clang::ModuleMap::isHeaderInUnavailableModule(), and print().
| const FileEntry* clang::Module::getUmbrellaHeader | ( | ) | const [inline] |
Retrieve the header that serves as the umbrella header for this module.
Definition at line 236 of file Basic/Module.h.
References Umbrella.
Referenced by clang::GenerateModuleAction::BeginSourceFileAction(), collectModuleHeaderIncludes(), getUmbrellaDir(), and print().
| 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 242 of file Basic/Module.h.
References Umbrella.
| bool clang::Module::isAvailable | ( | ) | const [inline] |
Determine whether this module is available for use within the current translation unit.
Definition at line 174 of file Basic/Module.h.
References IsAvailable.
Referenced by clang::GenerateModuleAction::BeginSourceFileAction(), collectModuleHeaderIncludes(), clang::ModuleMap::findModuleForHeader(), clang::ModuleMap::isHeaderInUnavailableModule(), clang::CompilerInstance::loadModule(), clang::ASTReader::makeModuleVisible(), and Module().
| bool Module::isAvailable | ( | const LangOptions & | LangOpts, |
| const TargetInfo & | Target, | ||
| StringRef & | Feature | ||
| ) | 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. |
| Feature | If this module is unavailable, this parameter will be set to one of the features that is required for use of this module (but is not available). |
Definition at line 68 of file Basic/Module.cpp.
References hasFeature(), IsAvailable, and Parent.
| 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 201 of file Basic/Module.h.
References Parent.
| bool clang::Module::isSubModule | ( | ) | const [inline] |
Determine whether this module is a submodule.
Definition at line 192 of file Basic/Module.h.
References Parent.
| bool Module::isSubModuleOf | ( | Module * | Other | ) | const |
Determine whether this module is a submodule of the given other module.
Definition at line 85 of file Basic/Module.cpp.
References Parent.
Referenced by clang::ASTWriter::inferSubmoduleIDFromLocation(), and clang::ASTReader::makeModuleVisible().
| void Module::print | ( | llvm::raw_ostream & | OS, |
| unsigned | Indent = 0 |
||
| ) | const |
Print the module map for this module to the given stream.
Definition at line 178 of file Basic/Module.cpp.
References Exports, getUmbrellaDir(), getUmbrellaHeader(), Headers, InferExplicitSubmodules, InferExportWildcard, InferSubmodules, IsExplicit, IsFramework, IsSystem, Name, printModuleId(), Requires, submodule_begin(), submodule_end(), and UnresolvedExports.
Referenced by compileModule(), and dump().
| submodule_iterator clang::Module::submodule_begin | ( | ) | [inline] |
Definition at line 268 of file Basic/Module.h.
Referenced by clang::Sema::ActOnEndOfTranslationUnit(), addRequirement(), clang::Sema::CodeCompleteModuleImport(), collectModuleHeaderIncludes(), getNumberOfModules(), clang::CompilerInstance::loadModule(), clang::ASTReader::makeModuleVisible(), print(), and ~Module().
| submodule_const_iterator clang::Module::submodule_begin | ( | ) | const [inline] |
Definition at line 269 of file Basic/Module.h.
| submodule_iterator clang::Module::submodule_end | ( | ) | [inline] |
Definition at line 270 of file Basic/Module.h.
Referenced by clang::Sema::ActOnEndOfTranslationUnit(), addRequirement(), clang::Sema::CodeCompleteModuleImport(), collectModuleHeaderIncludes(), getNumberOfModules(), clang::CompilerInstance::loadModule(), clang::ASTReader::makeModuleVisible(), print(), and ~Module().
| submodule_const_iterator clang::Module::submodule_end | ( | ) | const [inline] |
Definition at line 271 of file Basic/Module.h.
The location of the module definition.
Definition at line 49 of file Basic/Module.h.
Referenced by clang::ModuleMap::getContainingModuleMapFile().
| llvm::SmallVector<ExportDecl, 2> clang::Module::Exports |
The set of export declarations.
Definition at line 137 of file Basic/Module.h.
Referenced by clang::ModuleMap::findModuleForHeader(), clang::ModuleMap::inferFrameworkModule(), clang::ASTReader::makeModuleVisible(), print(), and clang::ModuleMap::resolveExports().
| llvm::SmallVector<const FileEntry *, 2> clang::Module::Headers |
The headers that are part of this module.
Definition at line 68 of file Basic/Module.h.
Referenced by clang::ModuleMap::addHeader(), collectModuleHeaderIncludes(), and print().
| llvm::SmallVector<Module *, 2> clang::Module::Imports |
The set of modules imported by this module, and on which this module depends.
Definition at line 128 of file Basic/Module.h.
Referenced by clang::ASTReader::makeModuleVisible().
Whether, when inferring submodules, the inferred submodules should be explicit.
Definition at line 102 of file Basic/Module.h.
Referenced by clang::ModuleMap::findModuleForHeader(), and print().
| 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 106 of file Basic/Module.h.
Referenced by clang::ModuleMap::findModuleForHeader(), clang::ModuleMap::inferFrameworkModule(), and print().
The location of the inferred submodule.
Definition at line 124 of file Basic/Module.h.
| 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 98 of file Basic/Module.h.
Referenced by clang::ModuleMap::findModuleForHeader(), clang::ModuleMap::inferFrameworkModule(), clang::ModuleMap::isHeaderInUnavailableModule(), and print().
| unsigned clang::Module::IsAvailable |
Whether this module is available in the current translation unit.
Definition at line 79 of file Basic/Module.h.
Referenced by addRequirement(), isAvailable(), and Module().
| unsigned clang::Module::IsExplicit |
Whether this is an explicit submodule.
Definition at line 88 of file Basic/Module.h.
Referenced by print().
| unsigned clang::Module::IsFramework |
Whether this is a framework module.
Definition at line 85 of file Basic/Module.h.
Referenced by appendSubframeworkPaths(), and print().
| unsigned clang::Module::IsFromModuleFile |
Whether this module was loaded from a module file.
Definition at line 82 of file Basic/Module.h.
Referenced by clang::CompilerInstance::loadModule().
| unsigned clang::Module::IsSystem |
Whether this is a "system" module (which assumes that all headers in it are system headers).
Definition at line 92 of file Basic/Module.h.
Referenced by clang::GenerateModuleAction::BeginSourceFileAction(), clang::ModuleMap::inferFrameworkModule(), Module(), and print().
| std::string clang::Module::Name |
The name of this module.
Definition at line 46 of file Basic/Module.h.
Referenced by appendSubframeworkPaths(), clang::GenerateModuleAction::BeginSourceFileAction(), compileModule(), clang::HeaderSearch::getModuleFileName(), getTopLevelModuleName(), Module(), and print().
\ brief The visibility of names within this particular module.
Definition at line 121 of file Basic/Module.h.
Referenced by clang::ASTReader::makeModuleVisible().
The parent of this module. This will be NULL for the top-level module.
Definition at line 53 of file Basic/Module.h.
Referenced by clang::Sema::ActOnModuleImport(), appendSubframeworkPaths(), collectModuleHeaderIncludes(), clang::ModuleMap::findModuleForHeader(), getFullModuleName(), getNumModuleIdentifiers(), getTopLevelModule(), isAvailable(), clang::ModuleMap::isHeaderInUnavailableModule(), isPartOfFramework(), isSubModule(), isSubModuleOf(), and clang::ModuleMap::lookupModuleUnqualified().
| llvm::SmallVector<std::string, 2> clang::Module::Requires |
The set of language features required to use this module.
If any of these features is not present, the IsAvailable bit will be false to indicate that this (sub)module is not available.
Definition at line 75 of file Basic/Module.h.
Referenced by addRequirement(), and print().
| llvm::PointerUnion<const DirectoryEntry *, const FileEntry *> clang::Module::Umbrella |
The umbrella header or directory.
Definition at line 56 of file Basic/Module.h.
Referenced by getUmbrellaDir(), getUmbrellaHeader(), hasUmbrellaDir(), clang::ModuleMap::inferFrameworkModule(), clang::ModuleMap::setUmbrellaDir(), and clang::ModuleMap::setUmbrellaHeader().
| llvm::SmallVector<UnresolvedExportDecl, 2> clang::Module::UnresolvedExports |
The set of export declarations that have yet to be resolved.
Definition at line 155 of file Basic/Module.h.
Referenced by print(), and clang::ModuleMap::resolveExports().