clang 17.0.0git
|
#include "clang/Lex/ModuleMap.h"
Classes | |
class | KnownHeader |
A header that is known to reside within a given module, whether it was included or excluded. More... | |
Public Types | |
enum | ModuleHeaderRole { NormalHeader = 0x0 , PrivateHeader = 0x1 , TextualHeader = 0x2 , ExcludedHeader = 0x4 } |
Flags describing the role of a module header. More... | |
using | AdditionalModMapsSet = llvm::SmallPtrSet< const FileEntry *, 1 > |
using | module_iterator = llvm::StringMap< Module * >::const_iterator |
Public Member Functions | |
void | resolveLinkAsDependencies (Module *Mod) |
Use PendingLinkAsModule information to mark top level link names that are going to be replaced by export_as aliases. | |
void | addLinkAsDependency (Module *Mod) |
Make module to use export_as as the link dependency name if enough information is available or add it to a pending list otherwise. | |
ModuleMap (SourceManager &SourceMgr, DiagnosticsEngine &Diags, const LangOptions &LangOpts, const TargetInfo *Target, HeaderSearch &HeaderInfo) | |
Construct a new module map. | |
~ModuleMap () | |
Destroy the module map. | |
void | setTarget (const TargetInfo &Target) |
Set the target information. | |
void | setBuiltinIncludeDir (const DirectoryEntry *Dir) |
Set the directory that contains Clang-supplied include files, such as our stdarg.h or tgmath.h. | |
const DirectoryEntry * | getBuiltinDir () const |
Get the directory that contains Clang-supplied include files. | |
bool | isBuiltinHeader (const FileEntry *File) |
void | addModuleMapCallbacks (std::unique_ptr< ModuleMapCallbacks > Callback) |
Add a module map callback. | |
KnownHeader | findModuleForHeader (const FileEntry *File, bool AllowTextual=false, bool AllowExcluded=false) |
Retrieve the module that owns the given header file, if any. | |
ArrayRef< KnownHeader > | findAllModulesForHeader (const FileEntry *File) |
Retrieve all the modules that contain the given header file. | |
ArrayRef< KnownHeader > | findResolvedModulesForHeader (const FileEntry *File) const |
Like findAllModulesForHeader, but do not attempt to infer module ownership from umbrella headers if we've not already done so. | |
void | resolveHeaderDirectives (const FileEntry *File) const |
Resolve all lazy header directives for the specified file. | |
void | resolveHeaderDirectives (Module *Mod, std::optional< const FileEntry * > File) const |
Resolve lazy header directives for the specified module. | |
void | diagnoseHeaderInclusion (Module *RequestingModule, bool RequestingModuleIsModuleInterface, SourceLocation FilenameLoc, StringRef Filename, FileEntryRef File) |
Reports errors if a module must not include a specific file. | |
bool | isHeaderInUnavailableModule (const FileEntry *Header) const |
Determine whether the given header is part of a module marked 'unavailable'. | |
bool | isHeaderUnavailableInModule (const FileEntry *Header, const Module *RequestingModule) const |
Determine whether the given header is unavailable as part of the specified module. | |
Module * | findModule (StringRef Name) const |
Retrieve a module with the given name. | |
Module * | lookupModuleUnqualified (StringRef Name, Module *Context) const |
Retrieve a module with the given name using lexical name lookup, starting at the given context. | |
Module * | lookupModuleQualified (StringRef Name, Module *Context) const |
Retrieve a module with the given name within the given context, using direct (qualified) name lookup. | |
std::pair< Module *, bool > | findOrCreateModule (StringRef Name, Module *Parent, bool IsFramework, bool IsExplicit) |
Find a new module or submodule, or create it if it does not already exist. | |
Module * | createGlobalModuleFragmentForModuleUnit (SourceLocation Loc, Module *Parent=nullptr) |
Create a global module fragment for a C++ module unit. | |
Module * | createPrivateModuleFragmentForInterfaceUnit (Module *Parent, SourceLocation Loc) |
Create a global module fragment for a C++ module interface unit. | |
Module * | createModuleForInterfaceUnit (SourceLocation Loc, StringRef Name) |
Create a new module for a C++ module interface unit. | |
Module * | createHeaderUnit (SourceLocation Loc, StringRef Name, Module::Header H) |
Create a C++20 header unit. | |
Module * | inferFrameworkModule (const DirectoryEntry *FrameworkDir, bool IsSystem, Module *Parent) |
Infer the contents of a framework module map from the given framework directory. | |
Module * | createShadowedModule (StringRef Name, bool IsFramework, Module *ShadowingModule) |
Create a new top-level module that is shadowed by ShadowingModule . | |
void | finishModuleDeclarationScope () |
Creates a new declaration scope for module names, allowing previously defined modules to shadow definitions from the new scope. | |
bool | mayShadowNewModule (Module *ExistingModule) |
bool | canInferFrameworkModule (const DirectoryEntry *Dir) const |
Check whether a framework module can be inferred in the given directory. | |
OptionalFileEntryRef | getContainingModuleMapFile (const Module *Module) const |
Retrieve the module map file containing the definition of the given module. | |
OptionalFileEntryRef | getModuleMapFileForUniquing (const Module *M) const |
Get the module map file that (along with the module name) uniquely identifies this module. | |
void | setInferredModuleAllowedBy (Module *M, const FileEntry *ModMap) |
std::error_code | canonicalizeModuleMapPath (SmallVectorImpl< char > &Path) |
Canonicalize Path in a manner suitable for a module map file. | |
AdditionalModMapsSet * | getAdditionalModuleMapFiles (const Module *M) |
Get any module map files other than getModuleMapFileForUniquing(M) that define submodules of a top-level module M . | |
void | addAdditionalModuleMapFile (const Module *M, const FileEntry *ModuleMap) |
bool | resolveExports (Module *Mod, bool Complain) |
Resolve all of the unresolved exports in the given module. | |
bool | resolveUses (Module *Mod, bool Complain) |
Resolve all of the unresolved uses in the given module. | |
bool | resolveConflicts (Module *Mod, bool Complain) |
Resolve all of the unresolved conflicts in the given module. | |
void | setUmbrellaHeader (Module *Mod, FileEntryRef UmbrellaHeader, const Twine &NameAsWritten, const Twine &PathRelativeToRootModuleDirectory) |
Sets the umbrella header of the given module to the given header. | |
void | setUmbrellaDir (Module *Mod, const DirectoryEntry *UmbrellaDir, const Twine &NameAsWritten, const Twine &PathRelativeToRootModuleDirectory) |
Sets the umbrella directory of the given module to the given directory. | |
void | addHeader (Module *Mod, Module::Header Header, ModuleHeaderRole Role, bool Imported=false) |
Adds this header to the given module. | |
bool | parseModuleMapFile (const FileEntry *File, bool IsSystem, const DirectoryEntry *HomeDir, FileID ID=FileID(), unsigned *Offset=nullptr, SourceLocation ExternModuleLoc=SourceLocation()) |
Parse the given module map file, and record any modules we encounter. | |
void | dump () |
Dump the contents of the module map, for debugging purposes. | |
module_iterator | module_begin () const |
module_iterator | module_end () const |
llvm::iterator_range< module_iterator > | modules () const |
void | cacheModuleLoad (const IdentifierInfo &II, Module *M) |
Cache a module load. M might be nullptr. | |
std::optional< Module * > | getCachedModuleLoad (const IdentifierInfo &II) |
Return a cached module load. | |
Static Public Member Functions | |
static ModuleHeaderRole | headerKindToRole (Module::HeaderKind Kind) |
Convert a header kind to a role. Requires Kind to not be HK_Excluded. | |
static Module::HeaderKind | headerRoleToKind (ModuleHeaderRole Role) |
Convert a header role to a kind. | |
static bool | isModular (ModuleHeaderRole Role) |
Check if the header with the given role is a modular one. | |
static bool | isBuiltinHeader (StringRef FileName) |
Is this a compiler builtin header? | |
Friends | |
class | ModuleMapParser |
Definition at line 76 of file ModuleMap.h.
using clang::ModuleMap::AdditionalModMapsSet = llvm::SmallPtrSet<const FileEntry *, 1> |
Definition at line 199 of file ModuleMap.h.
using clang::ModuleMap::module_iterator = llvm::StringMap<Module *>::const_iterator |
Definition at line 722 of file ModuleMap.h.
Flags describing the role of a module header.
Definition at line 129 of file ModuleMap.h.
ModuleMap::ModuleMap | ( | SourceManager & | SourceMgr, |
DiagnosticsEngine & | Diags, | ||
const LangOptions & | LangOpts, | ||
const TargetInfo * | Target, | ||
HeaderSearch & | HeaderInfo | ||
) |
Construct a new module map.
SourceMgr | The source manager used to find module files and headers. This source manager should be shared with the header-search mechanism, since they will refer to the same headers. |
Diags | A diagnostic engine used for diagnostics. |
LangOpts | Language options for this translation unit. |
Target | The target for this translation unit. |
Definition at line 317 of file ModuleMap.cpp.
ModuleMap::~ModuleMap | ( | ) |
Destroy the module map.
Definition at line 325 of file ModuleMap.cpp.
Definition at line 1330 of file ModuleMap.cpp.
void ModuleMap::addHeader | ( | Module * | Mod, |
Module::Header | Header, | ||
ModuleHeaderRole | Role, | ||
bool | Imported = false |
||
) |
Adds this header to the given module.
Role | The role of the header wrt the module. |
Definition at line 1235 of file ModuleMap.cpp.
References clang::Module::Header::Entry, clang::Module::getTopLevelModule(), headerRoleToKind(), clang::Module::Headers, clang::LangOptions::isCompilingModule(), and clang::HeaderSearch::MarkFileModuleHeader().
Referenced by createHeaderUnit(), and clang::serialization::reader::HeaderFileInfoTrait::ReadData().
void ModuleMap::addLinkAsDependency | ( | Module * | Mod | ) |
Make module to use export_as as the link dependency name if enough information is available or add it to a pending list otherwise.
Definition at line 69 of file ModuleMap.cpp.
References clang::Module::ExportAsModule, findModule(), clang::Module::Name, and clang::Module::UseExportAsModuleLinkName.
|
inline |
Add a module map callback.
Definition at line 424 of file ModuleMap.h.
Referenced by clang::DependencyCollector::attachToPreprocessor(), and clang::ModuleDependencyCollector::attachToPreprocessor().
|
inline |
Cache a module load. M might be nullptr.
Definition at line 731 of file ModuleMap.h.
Referenced by clang::CompilerInstance::loadModule().
|
inline |
Check whether a framework module can be inferred in the given directory.
Definition at line 598 of file ModuleMap.h.
Referenced by loadModuleMapForModuleBuild().
std::error_code ModuleMap::canonicalizeModuleMapPath | ( | SmallVectorImpl< char > & | Path | ) |
Canonicalize Path
in a manner suitable for a module map file.
In particular, this canonicalizes the parent directory separately from the filename so that it does not affect header resolution relative to the modulemap.
Path
is not modified. Definition at line 1288 of file ModuleMap.cpp.
References clang::FileManager::getCanonicalName(), clang::FileManager::getDirectory(), clang::SourceManager::getFileManager(), and Parent.
Module * ModuleMap::createGlobalModuleFragmentForModuleUnit | ( | SourceLocation | Loc, |
Module * | Parent = nullptr |
||
) |
Create a global module fragment for a C++ module unit.
We model the global module fragment as a submodule of the module interface unit. Unfortunately, we can't create the module interface unit's Module until later, because we don't know what it will be called usually. See C++20 [module.unit]/7.2 for the case we could know its parent.
Definition at line 854 of file ModuleMap.cpp.
References clang::Module::GlobalModuleFragment, Parent, and clang::Result.
Module * ModuleMap::createHeaderUnit | ( | SourceLocation | Loc, |
StringRef | Name, | ||
Module::Header | H | ||
) |
Create a C++20 header unit.
Definition at line 903 of file ModuleMap.cpp.
References addHeader(), clang::LangOptions::CurrentModule, clang::Module::ModuleHeaderUnit, NormalHeader, and clang::Result.
Module * ModuleMap::createModuleForInterfaceUnit | ( | SourceLocation | Loc, |
StringRef | Name | ||
) |
Create a new module for a C++ module interface unit.
The module must not already exist, and will be configured for the current compilation.
Note that this also sets the current module to the newly-created module.
Definition at line 876 of file ModuleMap.cpp.
References clang::LangOptions::CurrentModule, clang::SourceManager::getFileEntryForID(), clang::SourceManager::getMainFileID(), clang::Module::ModuleInterfaceUnit, PrivateHeader, and clang::Result.
Module * ModuleMap::createPrivateModuleFragmentForInterfaceUnit | ( | Module * | Parent, |
SourceLocation | Loc | ||
) |
Create a global module fragment for a C++ module interface unit.
Definition at line 867 of file ModuleMap.cpp.
References Parent, clang::Module::PrivateModuleFragment, and clang::Result.
Module * ModuleMap::createShadowedModule | ( | StringRef | Name, |
bool | IsFramework, | ||
Module * | ShadowingModule | ||
) |
Create a new top-level module that is shadowed by ShadowingModule
.
Definition at line 1124 of file ModuleMap.cpp.
References clang::Result.
void ModuleMap::diagnoseHeaderInclusion | ( | Module * | RequestingModule, |
bool | RequestingModuleIsModuleInterface, | ||
SourceLocation | FilenameLoc, | ||
StringRef | Filename, | ||
FileEntryRef | File | ||
) |
Reports errors if a module must not include a specific file.
RequestingModule | The module including a file. |
RequestingModuleIsModuleInterface | true if the inclusion is in the interface of RequestingModule, false if it's in the implementation of RequestingModule. Value is ignored and meaningless if RequestingModule is nullptr. |
FilenameLoc | The location of the inclusion's filename. |
Filename | The included filename as written. |
File | The included file. |
Definition at line 474 of file ModuleMap.cpp.
References clang::Module::directlyUses(), ExcludedHeader, clang::File, Filename, clang::Module::getFullModuleName(), clang::ModuleMap::KnownHeader::getModule(), clang::ModuleMap::KnownHeader::getRole(), clang::Module::getTopLevelModule(), getTopLevelOrNull(), clang::LangOptions::isCompilingModule(), clang::Module::IsFramework, clang::Module::Name, clang::DiagnosticsEngine::Report(), resolveHeaderDirectives(), resolveUses(), and violatesPrivateInclude().
Referenced by clang::Preprocessor::LookupFile().
LLVM_DUMP_METHOD void ModuleMap::dump | ( | ) |
Dump the contents of the module map, for debugging purposes.
Definition at line 1335 of file ModuleMap.cpp.
References clang::Module::print().
ArrayRef< ModuleMap::KnownHeader > ModuleMap::findAllModulesForHeader | ( | const FileEntry * | File | ) |
Retrieve all the modules that contain the given header file.
Note that this does not implicitly load module maps, except for builtin headers, and does not consult the external source. (Those checks are the responsibility of HeaderSearch.)
Typically, findModuleForHeader should be used instead, as it picks the preferred module for the header.
Definition at line 686 of file ModuleMap.cpp.
References clang::File.
Referenced by clang::HeaderSearch::findAllModulesForHeader().
Module * ModuleMap::findModule | ( | StringRef | Name | ) | const |
Retrieve a module with the given name.
Name | The name of the module to look up. |
Definition at line 809 of file ModuleMap.cpp.
Referenced by addLinkAsDependency(), clang::serialization::ModuleManager::lookupByModuleName(), clang::HeaderSearch::lookupModule(), lookupModuleQualified(), lookupModuleUnqualified(), and resolveLinkAsDependencies().
ModuleMap::KnownHeader ModuleMap::findModuleForHeader | ( | const FileEntry * | File, |
bool | AllowTextual = false , |
||
bool | AllowExcluded = false |
||
) |
Retrieve the module that owns the given header file, if any.
Note that this does not implicitly load module maps, except for builtin headers, and does not consult the external source. (Those checks are the responsibility of HeaderSearch.)
File | The header file that is likely to be included. |
AllowTextual | If true and File is a textual header, return its owning module. Otherwise, no KnownHeader will be returned if the file is only known as a textual header. |
Definition at line 584 of file ModuleMap.cpp.
References ExcludedHeader, clang::File, clang::ModuleMap::KnownHeader::getModule(), clang::ModuleMap::KnownHeader::getRole(), clang::Module::getTopLevelModule(), isBetterKnownHeader(), clang::Result, and TextualHeader.
Referenced by clang::HeaderSearch::findModuleForHeader(), and clang::Preprocessor::getModuleForLocation().
std::pair< Module *, bool > ModuleMap::findOrCreateModule | ( | StringRef | Name, |
Module * | Parent, | ||
bool | IsFramework, | ||
bool | IsExplicit | ||
) |
Find a new module or submodule, or create it if it does not already exist.
Name | The name of the module to find or create. |
Parent | The module that will act as the parent of this submodule, or nullptr to indicate that this is a top-level module. |
IsFramework | Whether this is a framework module. |
IsExplicit | Whether this is an explicit submodule. |
Definition at line 834 of file ModuleMap.cpp.
References clang::LangOptions::CurrentModule, lookupModuleQualified(), Parent, and clang::Result.
ArrayRef< ModuleMap::KnownHeader > ModuleMap::findResolvedModulesForHeader | ( | const FileEntry * | File | ) | const |
Like findAllModulesForHeader, but do not attempt to infer module ownership from umbrella headers if we've not already done so.
Definition at line 698 of file ModuleMap.cpp.
References clang::File, and resolveHeaderDirectives().
|
inline |
Creates a new declaration scope for module names, allowing previously defined modules to shadow definitions from the new scope.
Definition at line 589 of file ModuleMap.h.
Referenced by clang::FrontendAction::BeginSourceFile().
|
inline |
Get any module map files other than getModuleMapFileForUniquing(M) that define submodules of a top-level module M
.
This is cheaper than getting the module map file for each submodule individually, since the expected number of results is very small.
Definition at line 638 of file ModuleMap.h.
|
inline |
Get the directory that contains Clang-supplied include files.
Definition at line 415 of file ModuleMap.h.
|
inline |
Return a cached module load.
Definition at line 736 of file ModuleMap.h.
Referenced by clang::CompilerInstance::loadModule().
OptionalFileEntryRef ModuleMap::getContainingModuleMapFile | ( | const Module * | Module | ) | const |
Retrieve the module map file containing the definition of the given module.
Module | The module whose module map file will be returned, if known. |
Definition at line 1264 of file ModuleMap.cpp.
References clang::Module::DefinitionLoc, clang::SourceManager::getFileEntryRefForID(), clang::SourceManager::getFileID(), and clang::SourceLocation::isInvalid().
Referenced by compileModule(), and getModuleMapFileForUniquing().
OptionalFileEntryRef ModuleMap::getModuleMapFileForUniquing | ( | const Module * | M | ) | const |
Get the module map file that (along with the module name) uniquely identifies this module.
The particular module that Name
refers to may depend on how the module was found in header search. However, the combination of Name
and this module map will be globally unique for top-level modules. In the case of inferred modules, returns the module map that allowed the inference (e.g. contained 'module *'). Otherwise, returns getContainingModuleMapFile().
Definition at line 1273 of file ModuleMap.cpp.
References getContainingModuleMapFile(), and clang::Module::IsInferred.
Referenced by clang::tooling::dependencies::ModuleDepCollector::applyDiscoveredDependencies(), compileModule(), clang::HeaderSearch::getCachedModuleFileName(), and clang::HeaderSearch::getPrebuiltImplicitModuleFileName().
|
static |
Convert a header kind to a role. Requires Kind to not be HK_Excluded.
Definition at line 93 of file ModuleMap.cpp.
References ExcludedHeader, clang::Module::HK_Excluded, clang::Module::HK_Normal, clang::Module::HK_Private, clang::Module::HK_PrivateTextual, clang::Module::HK_Textual, NormalHeader, PrivateHeader, and TextualHeader.
|
static |
Convert a header role to a kind.
Definition at line 76 of file ModuleMap.cpp.
References ExcludedHeader, clang::Module::HK_Excluded, clang::Module::HK_Normal, clang::Module::HK_Private, clang::Module::HK_PrivateTextual, clang::Module::HK_Textual, NormalHeader, PrivateHeader, and TextualHeader.
Referenced by addHeader().
Module * ModuleMap::inferFrameworkModule | ( | const DirectoryEntry * | FrameworkDir, |
bool | IsSystem, | ||
Module * | Parent | ||
) |
Infer the contents of a framework module map from the given framework directory.
Definition at line 941 of file ModuleMap.cpp.
References clang::Module::IsSystem, and Parent.
Definition at line 394 of file ModuleMap.cpp.
References clang::File, and isBuiltinHeader().
|
static |
Is this a compiler builtin header?
Determine whether the given file name is the name of a builtin header, supplied by Clang to replace, override, or augment existing system headers.
Definition at line 378 of file ModuleMap.cpp.
Referenced by isBuiltinHeader(), clang::HeaderSearch::ShouldEnterIncludeFile(), and suggestModule().
Determine whether the given header is part of a module marked 'unavailable'.
Definition at line 707 of file ModuleMap.cpp.
References isHeaderUnavailableInModule().
bool ModuleMap::isHeaderUnavailableInModule | ( | const FileEntry * | Header, |
const Module * | RequestingModule | ||
) | const |
Determine whether the given header is unavailable as part of the specified module.
Definition at line 712 of file ModuleMap.cpp.
References ExcludedHeader, clang::FileEntry::getDir(), clang::FileManager::getDirectory(), clang::SourceManager::getFileManager(), clang::DirectoryEntry::getName(), clang::FileEntry::getName(), clang::Module::getUmbrellaDir(), clang::if(), clang::Module::InferSubmodules, clang::Module::isAvailable(), clang::Module::isSubModuleOf(), lookupModuleQualified(), clang::Module::Parent, resolveHeaderDirectives(), sanitizeFilenameAsIdentifier(), and TextualHeader.
Referenced by collectModuleHeaderIncludes(), and isHeaderInUnavailableModule().
|
static |
Check if the header with the given role is a modular one.
Definition at line 109 of file ModuleMap.cpp.
References ExcludedHeader, and TextualHeader.
Referenced by clang::HeaderSearch::MarkFileModuleHeader(), and clang::serialization::reader::HeaderFileInfoTrait::ReadData().
Retrieve a module with the given name within the given context, using direct (qualified) name lookup.
Name | The name of the module to look up. |
Context | The module for which we will look for a submodule. If null, we will look for a top-level module. |
Definition at line 827 of file ModuleMap.cpp.
References findModule().
Referenced by findOrCreateModule(), isHeaderUnavailableInModule(), and lookupModuleUnqualified().
Retrieve a module with the given name using lexical name lookup, starting at the given context.
Name | The name of the module to look up. |
Context | The module context, from which we will perform lexical name lookup. |
Definition at line 817 of file ModuleMap.cpp.
References findModule(), and lookupModuleQualified().
Definition at line 591 of file ModuleMap.h.
References clang::Module::Parent.
|
inline |
Definition at line 724 of file ModuleMap.h.
Referenced by clang::CompilerInstance::loadGlobalModuleIndex(), and modules().
|
inline |
Definition at line 725 of file ModuleMap.h.
Referenced by clang::CompilerInstance::loadGlobalModuleIndex(), and modules().
|
inline |
Definition at line 726 of file ModuleMap.h.
References module_begin(), and module_end().
Referenced by clang::HeaderSearch::collectAllModules().
bool ModuleMap::parseModuleMapFile | ( | const FileEntry * | File, |
bool | IsSystem, | ||
const DirectoryEntry * | HomeDir, | ||
FileID | ID = FileID() , |
||
unsigned * | Offset = nullptr , |
||
SourceLocation | ExternModuleLoc = SourceLocation() |
||
) |
Parse the given module map file, and record any modules we encounter.
File | The file to be parsed. |
IsSystem | Whether this module map file is in a system header directory, and therefore should be considered a system module. |
HomeDir | The directory in which relative paths within this module map file will be resolved. |
ID | The FileID of the file to process, if we've already entered it. |
Offset | [inout] On input the offset at which to start parsing. On output, the offset at which the module map terminated. |
ExternModuleLoc | The location of the "extern module" declaration that caused us to load this module map file, if any. |
Definition at line 3053 of file ModuleMap.cpp.
References clang::SrcMgr::C_System_ModuleMap, clang::SrcMgr::C_User_ModuleMap, clang::SourceManager::createFileID(), clang::File, clang::SourceManager::getBufferOrNone(), clang::SourceManager::getDecomposedLoc(), clang::SourceManager::getLocForStartOfFile(), clang::Lexer::getSourceLocation(), Offset, and clang::Result.
Resolve all of the unresolved conflicts in the given module.
Mod | The module whose conflicts should be resolved. |
Complain | Whether to emit diagnostics for failures. |
Definition at line 1383 of file ModuleMap.cpp.
References clang::Module::Conflicts, clang::Module::Conflict::Message, clang::Module::Conflict::Other, clang::Unresolved, and clang::Module::UnresolvedConflicts.
Referenced by clang::Sema::ActOnEndOfTranslationUnit(), and clang::Preprocessor::EnterSubmodule().
Resolve all of the unresolved exports in the given module.
Mod | The module whose exports should be resolved. |
Complain | Whether to emit diagnostics for failures. |
Definition at line 1357 of file ModuleMap.cpp.
References clang::Module::Exports, clang::Unresolved, and clang::Module::UnresolvedExports.
Referenced by clang::Sema::ActOnEndOfTranslationUnit(), and clang::Preprocessor::EnterSubmodule().
void ModuleMap::resolveHeaderDirectives | ( | const FileEntry * | File | ) | const |
Resolve all lazy header directives for the specified file.
This ensures that the HeaderFileInfo on HeaderSearch is up to date. This is effectively internal, but is exposed so HeaderSearch can call it.
Definition at line 1200 of file ModuleMap.cpp.
References clang::File, and resolveHeaderDirectives().
Referenced by collectModuleHeaderIncludes(), diagnoseHeaderInclusion(), findResolvedModulesForHeader(), isHeaderUnavailableInModule(), resolveHeaderDirectives(), and clang::HeaderSearch::ShouldEnterIncludeFile().
void ModuleMap::resolveHeaderDirectives | ( | Module * | Mod, |
std::optional< const FileEntry * > | File | ||
) | const |
Resolve lazy header directives for the specified module.
If File is provided, only headers with same size and modtime are resolved. If File is not set, all headers are resolved.
Definition at line 1216 of file ModuleMap.cpp.
References clang::File, clang::Module::UnresolvedHeaderDirective::ModTime, clang::Module::UnresolvedHeaderDirective::Size, and clang::Module::UnresolvedHeaders.
void ModuleMap::resolveLinkAsDependencies | ( | Module * | Mod | ) |
Use PendingLinkAsModule information to mark top level link names that are going to be replaced by export_as aliases.
Definition at line 58 of file ModuleMap.cpp.
References findModule(), and clang::Module::Name.
Referenced by clang::CompilerInstance::loadModule().
Resolve all of the unresolved uses in the given module.
Mod | The module whose uses should be resolved. |
Complain | Whether to emit diagnostics for failures. |
Definition at line 1370 of file ModuleMap.cpp.
References clang::Module::DirectUses, clang::Unresolved, and clang::Module::UnresolvedDirectUses.
Referenced by clang::Sema::ActOnEndOfTranslationUnit(), diagnoseHeaderInclusion(), clang::Preprocessor::EnterSubmodule(), and suggestModule().
|
inline |
Set the directory that contains Clang-supplied include files, such as our stdarg.h or tgmath.h.
Definition at line 410 of file ModuleMap.h.
Referenced by clang::ApplyHeaderSearchOptions().
Definition at line 1282 of file ModuleMap.cpp.
References clang::Module::IsInferred.
Referenced by prepareToBuildModule().
void ModuleMap::setTarget | ( | const TargetInfo & | Target | ) |
Set the target information.
Definition at line 332 of file ModuleMap.cpp.
References clang::Target.
Referenced by clang::HeaderSearch::setTarget().
void ModuleMap::setUmbrellaDir | ( | Module * | Mod, |
const DirectoryEntry * | UmbrellaDir, | ||
const Twine & | NameAsWritten, | ||
const Twine & | PathRelativeToRootModuleDirectory | ||
) |
Sets the umbrella directory of the given module to the given directory.
Definition at line 1154 of file ModuleMap.cpp.
References clang::Module::Umbrella, clang::Module::UmbrellaAsWritten, and clang::Module::UmbrellaRelativeToRootModuleDirectory.
void ModuleMap::setUmbrellaHeader | ( | Module * | Mod, |
FileEntryRef | UmbrellaHeader, | ||
const Twine & | NameAsWritten, | ||
const Twine & | PathRelativeToRootModuleDirectory | ||
) |
Sets the umbrella header of the given module to the given header.
Definition at line 1139 of file ModuleMap.cpp.
References clang::FileEntryRef::getDir(), clang::SourceManager::getFileManager(), clang::FileEntryRef::getMapEntry(), NormalHeader, clang::Module::Umbrella, clang::Module::UmbrellaAsWritten, and clang::Module::UmbrellaRelativeToRootModuleDirectory.
|
friend |
Definition at line 202 of file ModuleMap.h.