clang 8.0.0

Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::ModuleMap Class Reference

`#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 }
| 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. More...
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. More...
| ModuleMap (SourceManager &SourceMgr, DiagnosticsEngine &Diags, const LangOptions &LangOpts, const TargetInfo *Target, HeaderSearch &HeaderInfo)
| Construct a new module map. More...
| ~ModuleMap ()
| Destroy the module map. More...
void | setTarget (const TargetInfo &Target)
| Set the target information. More...
void | setBuiltinIncludeDir (const DirectoryEntry *Dir)
| Set the directory that contains Clang-supplied include files, such as our stdarg.h or tgmath.h. More...
const DirectoryEntry * | getBuiltinDir () const
| Get the directory that contains Clang-supplied include files. More...
void | addModuleMapCallbacks (std::unique_ptr< ModuleMapCallbacks > Callback)
| Add a module map callback. More...
KnownHeader | findModuleForHeader (const FileEntry *File, bool AllowTextual=false)
| Retrieve the module that owns the given header file, if any. More...
ArrayRef< KnownHeader > | findAllModulesForHeader (const FileEntry *File) const
| Retrieve all the modules that contain the given header file. More...
void | resolveHeaderDirectives (const FileEntry *File) const
| Resolve all lazy header directives for the specified file. More...
void | resolveHeaderDirectives (Module *Mod) const
| Resolve all lazy header directives for the specified module. More...
void | diagnoseHeaderInclusion (Module *RequestingModule, bool RequestingModuleIsModuleInterface, SourceLocation FilenameLoc, StringRef Filename, const FileEntry *File)
| Reports errors if a module must not include a specific file. More...
bool | isHeaderInUnavailableModule (const FileEntry *Header) const
| Determine whether the given header is part of a module marked 'unavailable'. More...
bool | isHeaderUnavailableInModule (const FileEntry *Header, const Module *RequestingModule) const
| Determine whether the given header is unavailable as part of the specified module. More...
Module * | findModule (StringRef Name) const
| Retrieve a module with the given name. More...
Module * | lookupModuleUnqualified (StringRef Name, Module *Context) const
| Retrieve a module with the given name using lexical name lookup, starting at the given context. More...
Module * | lookupModuleQualified (StringRef Name, Module *Context) const
| Retrieve a module with the given name within the given context, using direct (qualified) name lookup. More...
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. More...
Module * | createGlobalModuleForInterfaceUnit (SourceLocation Loc)
| Create a 'global module' for a C++ Modules TS module interface unit. More...
Module * | createModuleForInterfaceUnit (SourceLocation Loc, StringRef Name, Module *GlobalModule)
| Create a new module for a C++ Modules TS module interface unit. More...
Module * | createHeaderModule (StringRef Name, ArrayRef< Module::Header > Headers)
| Create a header module from the specified list of headers. More...
Module * | inferFrameworkModule (const DirectoryEntry *FrameworkDir, bool IsSystem, Module *Parent)
| Infer the contents of a framework module map from the given framework directory. More...
Module * | createShadowedModule (StringRef Name, bool IsFramework, Module *ShadowingModule)
| Create a new top-level module that is shadowed by `ShadowingModule`. More...
void | finishModuleDeclarationScope ()
| Creates a new declaration scope for module names, allowing previously defined modules to shadow definitions from the new scope. More...
bool | mayShadowNewModule (Module *ExistingModule)
const FileEntry * | getContainingModuleMapFile (const Module *Module) const
| Retrieve the module map file containing the definition of the given module. More...
const FileEntry * | getModuleMapFileForUniquing (const Module *M) const
| Get the module map file that (along with the module name) uniquely identifies this module. More...
void | setInferredModuleAllowedBy (Module *M, const FileEntry *ModMap)
AdditionalModMapsSet * | getAdditionalModuleMapFiles (const Module *M)
| Get any module map files other than getModuleMapFileForUniquing(M) that define submodules of a top-level module `M`. More...
void | addAdditionalModuleMapFile (const Module *M, const FileEntry *ModuleMap)
bool | resolveExports (Module *Mod, bool Complain)
| Resolve all of the unresolved exports in the given module. More...
bool | resolveUses (Module *Mod, bool Complain)
| Resolve all of the unresolved uses in the given module. More...
bool | resolveConflicts (Module *Mod, bool Complain)
| Resolve all of the unresolved conflicts in the given module. More...
void | setUmbrellaHeader (Module *Mod, const FileEntry *UmbrellaHeader, Twine NameAsWritten)
| Sets the umbrella header of the given module to the given header. More...
void | setUmbrellaDir (Module *Mod, const DirectoryEntry *UmbrellaDir, Twine NameAsWritten)
| Sets the umbrella directory of the given module to the given directory. More...
void | addHeader (Module *Mod, Module::Header Header, ModuleHeaderRole Role, bool Imported=false)
| Adds this header to the given module. More...
void | excludeHeader (Module *Mod, Module::Header Header)
| Marks this header as being excluded from the given module. More...
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. More...
void | dump ()
| Dump the contents of the module map, for debugging purposes. More...
module_iterator | module_begin () const
module_iterator | module_end () const

## Static Public Member Functions
static ModuleHeaderRole | headerKindToRole (Module::HeaderKind Kind)
| Convert a header kind to a role. Requires Kind to not be HK_Excluded. More...
static Module::HeaderKind | headerRoleToKind (ModuleHeaderRole Role)
| Convert a header role to a kind. More...
static bool | isBuiltinHeader (StringRef FileName)
| Is this a compiler builtin header? More...

## Friends
class | ModuleMapParser

## Detailed Description

Definition at line 75 of file ModuleMap.h.

## Member Typedef Documentation

## ◆ AdditionalModMapsSet

using clang::ModuleMap::AdditionalModMapsSet = llvm::SmallPtrSet<const FileEntry *, 1>

Definition at line 189 of file ModuleMap.h.

## ◆ module_iterator

using clang::ModuleMap::module_iterator = llvm::StringMap<Module *>::const_iterator

Definition at line 680 of file ModuleMap.h.

## Member Enumeration Documentation

## ◆ ModuleHeaderRole

enum clang::ModuleMap::ModuleHeaderRole

Flags describing the role of a module header.

Enumerator
NormalHeader | This header is normally included in the module.
PrivateHeader | This header is included but private.
TextualHeader | This header is part of the module (for layering purposes) but should be textually included.

Definition at line 124 of file ModuleMap.h.

## Constructor & Destructor Documentation

## ◆ ModuleMap()

ModuleMap::ModuleMap | ( | SourceManager & | SourceMgr,
|  | DiagnosticsEngine & | Diags,
|  | const LangOptions & | LangOpts,
|  | const TargetInfo * | Target,
|  | HeaderSearch & | HeaderInfo
| ) |  |

Construct a new module map.

Parameters

  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 314 of file ModuleMap.cpp.

## ◆ ~ModuleMap()

ModuleMap::~ModuleMap | ( |  | ) |

Destroy the module map.

Definition at line 322 of file ModuleMap.cpp.

## Member Function Documentation

## ◆ addAdditionalModuleMapFile()

void clang::ModuleMap::addAdditionalModuleMapFile | ( | const Module * | M,
|  | const FileEntry * | ModuleMap
| ) |  |
| inline

Definition at line 600 of file ModuleMap.h.

References dump(), and Offset.

## ◆ addHeader()

void ModuleMap::addHeader | ( | Module * | Mod,
|  | Module::Header | Header,
|  | ModuleHeaderRole | Role,
|  | bool | Imported = `false`
| ) |  |

Adds this header to the given module.

Parameters

  Role | The role of the header wrt the module.

Definition at line 1166 of file ModuleMap.cpp.

References clang::Module::Header::Entry, clang::FileEntry::getName(), clang::Module::getTopLevelModule(), headerRoleToKind(), clang::Module::Headers, clang::LangOptions::isCompilingModule(), and clang::HeaderSearch::MarkFileModuleHeader().

Referenced by clang::serialization::reader::HeaderFileInfoTrait::ReadData().

## ◆ addLinkAsDependency()

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 70 of file ModuleMap.cpp.

References clang::Module::ExportAsModule, clang::Module::Name, and clang::Module::UseExportAsModuleLinkName.

## ◆ addModuleMapCallbacks()

void clang::ModuleMap::addModuleMapCallbacks | ( | std::unique_ptr< ModuleMapCallbacks > | Callback | ) |
| inline

Add a module map callback.

Definition at line 414 of file ModuleMap.h.

Referenced by clang::DependencyCollector::attachToPreprocessor(), and clang::ModuleDependencyCollector::attachToPreprocessor().

## ◆ createGlobalModuleForInterfaceUnit()

Module * ModuleMap::createGlobalModuleForInterfaceUnit | ( | SourceLocation | Loc | ) |

Create a 'global module' for a C++ Modules TS module interface unit.

We model the global module 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.

Definition at line 810 of file ModuleMap.cpp.

References clang::Module::GlobalModuleFragment.

Referenced by clang::Sema::ActOnStartOfTranslationUnit().

## ◆ createHeaderModule()

Module * ModuleMap::createHeaderModule | ( | StringRef | Name,
|  | ArrayRef< Module::Header > | Headers
| ) |  |

Create a header module from the specified list of headers.

Definition at line 846 of file ModuleMap.cpp.

## ◆ createModuleForInterfaceUnit()

Module * ModuleMap::createModuleForInterfaceUnit | ( | SourceLocation | Loc,
|  | StringRef | Name,
|  | Module * | GlobalModule
| ) |  |

Create a new module for a C++ Modules TS 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.

Returns
  The newly-created module.

Definition at line 818 of file ModuleMap.cpp.

## ◆ createShadowedModule()

Module * ModuleMap::createShadowedModule | ( | StringRef | Name,
|  | bool | IsFramework,
|  | Module * | ShadowingModule
| ) |  |

Create a new top-level module that is shadowed by `ShadowingModule`.

Definition at line 1071 of file ModuleMap.cpp.

## ◆ diagnoseHeaderInclusion()

void ModuleMap::diagnoseHeaderInclusion | ( | Module * | RequestingModule,
|  | bool | RequestingModuleIsModuleInterface,
|  | SourceLocation | FilenameLoc,
|  | StringRef | Filename,
|  | const FileEntry * | File
| ) |  |

Reports errors if a module must not include a specific file.

Parameters

  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 466 of file ModuleMap.cpp.

References clang::Module::directlyUses(), Filename, clang::Module::getFullModuleName(), clang::ModuleMap::KnownHeader::getModule(), clang::FileEntry::getName(), 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().

## ◆ dump()

LLVM_DUMP_METHOD void ModuleMap::dump | ( |  | ) |

Dump the contents of the module map, for debugging purposes.

Definition at line 1227 of file ModuleMap.cpp.

References clang::Module::print().

## ◆ excludeHeader()

void ModuleMap::excludeHeader | ( | Module * | Mod,
|  | Module::Header | Header
| ) |  |

Marks this header as being excluded from the given module.

Definition at line 1195 of file ModuleMap.cpp.

References clang::Module::Header::Entry, clang::Module::Headers, and clang::Module::HK_Excluded.

## ◆ findAllModulesForHeader()

ArrayRef< ModuleMap::KnownHeader > ModuleMap::findAllModulesForHeader | ( | const FileEntry * | File | ) | const

Retrieve all the modules that contain the given header file.

This may not include umbrella modules, nor information from external sources, if they have not yet been inferred / loaded.

Typically, findModuleForHeader should be used instead, as it picks the preferred module for the header.

Definition at line 660 of file ModuleMap.cpp.

References clang::None, and resolveHeaderDirectives().

Referenced by CreateSLocExpansionAbbrev(), and clang::Preprocessor::getModuleHeaderToIncludeForDiagnostics().

## ◆ findModule()

Module * ModuleMap::findModule | ( | StringRef | Name | ) | const

Retrieve a module with the given name.

Parameters

  Name | The name of the module to look up.

Returns
  The named module, if known; otherwise, returns null.

Definition at line 765 of file ModuleMap.cpp.

Referenced by clang::CompilerInstance::loadModuleFile(), clang::HeaderSearch::lookupModule(), and clang::serialization::ModuleManager::removeModules().

## ◆ findModuleForHeader()

ModuleMap::KnownHeader ModuleMap::findModuleForHeader | ( | const FileEntry * | File,
|  | bool | AllowTextual = `false`
| ) |  |

Retrieve the module that owns the given header file, if any.

Parameters

  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.

Returns
  The module KnownHeader, which provides the module that owns the given header file. The KnownHeader is default constructed to indicate that no module owns this header file.

Definition at line 562 of file ModuleMap.cpp.

References clang::ModuleMap::KnownHeader::getModule(), getModuleMapFileForUniquing(), clang::Module::getTopLevelModule(), clang::Module::getUmbrellaDir(), clang::if(), clang::Module::InferExplicitSubmodules, clang::Module::InferSubmodules, isBetterKnownHeader(), clang::Module::Parent, clang::Result, and TextualHeader.

Referenced by clang::Preprocessor::getModuleForLocation().

## ◆ findOrCreateModule()

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.

Parameters

  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.

Returns
  The found or newly-created module, along with a boolean value that will be true if the module is newly-created.

Definition at line 790 of file ModuleMap.cpp.

## ◆ finishModuleDeclarationScope()

void clang::ModuleMap::finishModuleDeclarationScope | ( |  | ) |
| inline

Creates a new declaration scope for module names, allowing previously defined modules to shadow definitions from the new scope.

Note
  Module names from earlier scopes will shadow names from the new scope, which is the opposite of how shadowing works for variables.

Definition at line 559 of file ModuleMap.h.

Referenced by clang::FrontendAction::BeginSourceFile().

## ◆ getAdditionalModuleMapFiles()

AdditionalModMapsSet* clang::ModuleMap::getAdditionalModuleMapFiles | ( | const Module * | M | ) |
| 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 593 of file ModuleMap.h.

## ◆ getBuiltinDir()

const DirectoryEntry* clang::ModuleMap::getBuiltinDir | ( |  | ) | const
| inline

Get the directory that contains Clang-supplied include files.

Definition at line 406 of file ModuleMap.h.

## ◆ getContainingModuleMapFile()

const FileEntry * ModuleMap::getContainingModuleMapFile | ( | const Module * | Module | ) | const

Retrieve the module map file containing the definition of the given module.

Parameters

  Module | The module whose module map file will be returned, if known.

Returns
  The file entry for the module map file containing the given module, or nullptr if the module definition was inferred.

Definition at line 1206 of file ModuleMap.cpp.

References clang::Module::DefinitionLoc, clang::SourceManager::getFileEntryForID(), clang::SourceManager::getFileID(), and clang::SourceLocation::isInvalid().

Referenced by compileModuleImpl(), and getModuleMapFileForUniquing().

## ◆ getModuleMapFileForUniquing()

const FileEntry * 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 1214 of file ModuleMap.cpp.

References getContainingModuleMapFile(), and clang::Module::IsInferred.

Referenced by compileModuleImpl(), findModuleForHeader(), and clang::HeaderSearch::getCachedModuleFileName().

## ◆ headerKindToRole()

ModuleMap::ModuleHeaderRole ModuleMap::headerKindToRole | ( | Module::HeaderKind | Kind | ) |
| static

Convert a header kind to a role. Requires Kind to not be HK_Excluded.

Definition at line 92 of file ModuleMap.cpp.

References clang::Module::HK_Excluded, clang::Module::HK_Normal, clang::Module::HK_Private, clang::Module::HK_PrivateTextual, clang::Module::HK_Textual, clang::Module::UnresolvedExportDecl::Id, and clang::Module::UnresolvedExportDecl::Wildcard.

Referenced by CreateSLocExpansionAbbrev(), and setUmbrellaDir().

## ◆ headerRoleToKind()

Module::HeaderKind ModuleMap::headerRoleToKind | ( | ModuleHeaderRole | Role | ) |
| static

Convert a header role to a kind.

Definition at line 77 of file ModuleMap.cpp.

References clang::Module::HK_Normal, clang::Module::HK_Private, clang::Module::HK_PrivateTextual, and clang::Module::HK_Textual.

Referenced by addHeader(), and setUmbrellaDir().

## ◆ inferFrameworkModule()

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 894 of file ModuleMap.cpp.

References clang::FileManager::getCanonicalName(), clang::FileManager::getDirectory(), clang::SourceManager::getFileManager(), clang::Module::IsSystem, clang::HeaderSearch::lookupModuleMapFile(), lookupModuleQualified(), Parent, parseModuleMapFile(), and sanitizeFilenameAsIdentifier().

## ◆ isBuiltinHeader()

bool ModuleMap::isBuiltinHeader | ( | StringRef | FileName | ) |
| 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 375 of file ModuleMap.cpp.

References clang::FileManager::getCanonicalName(), clang::FileEntry::getDir(), clang::FileManager::getDirectory(), clang::SourceManager::getFileManager(), clang::HeaderSearch::getHeaderSearchOpts(), clang::FileEntry::getName(), clang::HeaderSearchOptions::ImplicitModuleMaps, clang::HeaderSearch::loadTopLevelSystemModules(), NormalHeader, and resolveHeaderDirectives().

Referenced by clang::HeaderSearch::ShouldEnterIncludeFile().

## ◆ isHeaderInUnavailableModule()

bool ModuleMap::isHeaderInUnavailableModule | ( | const FileEntry * | Header | ) | const

Determine whether the given header is part of a module marked 'unavailable'.

Definition at line 668 of file ModuleMap.cpp.

References isHeaderUnavailableInModule().

Referenced by collectAllSubModulesWithUmbrellaHeader().

## ◆ 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 673 of file ModuleMap.cpp.

References clang::FileEntry::getDir(), clang::DirectoryEntry::getName(), clang::Module::getUmbrellaDir(), clang::if(), clang::Module::InferSubmodules, clang::Module::isAvailable(), clang::Module::isSubModuleOf(), clang::Module::Parent, resolveHeaderDirectives(), and TextualHeader.

Referenced by collectModuleHeaderIncludes(), and isHeaderInUnavailableModule().

## ◆ lookupModuleQualified()

Module * ModuleMap::lookupModuleQualified | ( | StringRef | Name,
|  | Module * | Context
| ) |  | const

Retrieve a module with the given name within the given context, using direct (qualified) name lookup.

Parameters

  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.

Returns
  The named submodule, if known; otherwose, returns null.

Definition at line 783 of file ModuleMap.cpp.

Referenced by inferFrameworkModule().

## ◆ lookupModuleUnqualified()

Module * ModuleMap::lookupModuleUnqualified | ( | StringRef | Name,
|  | Module * | Context
| ) |  | const

Retrieve a module with the given name using lexical name lookup, starting at the given context.

Parameters

  Name | The name of the module to look up.
  Context | The module context, from which we will perform lexical name lookup.

Returns
  The named module, if known; otherwise, returns null.

Definition at line 773 of file ModuleMap.cpp.

## ◆ mayShadowNewModule()

bool clang::ModuleMap::mayShadowNewModule | ( | Module * | ExistingModule | ) |
| inline

Definition at line 561 of file ModuleMap.h.

References clang::Module::Parent.

## ◆ module_begin()

module_iterator clang::ModuleMap::module_begin | ( |  | ) | const
| inline

Definition at line 682 of file ModuleMap.h.

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

## ◆ module_end()

module_iterator clang::ModuleMap::module_end | ( |  | ) | const
| inline

Definition at line 683 of file ModuleMap.h.

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

## ◆ parseModuleMapFile()

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.

Parameters

  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.

Returns
  true if an error occurred, false otherwise.

Definition at line 2944 of file ModuleMap.cpp.

References clang::SrcMgr::C_System_ModuleMap, clang::SrcMgr::C_User_ModuleMap, clang::ModuleMapParser::getLocation(), clang::if(), clang::FileID::isInvalid(), Offset, clang::ModuleMapParser::parseModuleMapFile(), clang::Result, and clang::Target.

Referenced by inferFrameworkModule(), and clang::ModuleMapParser::ModuleMapParser().

## ◆ resolveConflicts()

bool ModuleMap::resolveConflicts | ( | Module * | Mod,
|  | bool | Complain
| ) |  |

Resolve all of the unresolved conflicts in the given module.

Parameters

  Mod | The module whose conflicts should be resolved.
  Complain | Whether to emit diagnostics for failures.

Returns
  true if any errors were encountered while resolving conflicts, false otherwise.

Definition at line 1275 of file ModuleMap.cpp.

References clang::Module::Conflicts, clang::Module::Conflict::Message, clang::Module::Conflict::Other, and clang::Module::UnresolvedConflicts.

Referenced by clang::Preprocessor::EnterSubmodule().

## ◆ resolveExports()

bool ModuleMap::resolveExports | ( | Module * | Mod,
|  | bool | Complain
| ) |  |

Resolve all of the unresolved exports in the given module.

Parameters

  Mod | The module whose exports should be resolved.
  Complain | Whether to emit diagnostics for failures.

Returns
  true if any errors were encountered while resolving exports, false otherwise.

Definition at line 1249 of file ModuleMap.cpp.

References clang::Module::Exports, and clang::Module::UnresolvedExports.

Referenced by clang::Preprocessor::EnterSubmodule().

## ◆ resolveHeaderDirectives() [1/2]

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 1141 of file ModuleMap.cpp.

References clang::FileEntry::getModificationTime(), and clang::FileEntry::getSize().

Referenced by collectModuleHeaderIncludes(), CreateSLocExpansionAbbrev(), diagnoseHeaderInclusion(), findAllModulesForHeader(), isBuiltinHeader(), and isHeaderUnavailableInModule().

## ◆ resolveHeaderDirectives() [2/2]

void ModuleMap::resolveHeaderDirectives | ( | Module * | Mod | ) | const

Resolve all lazy header directives for the specified module.

Definition at line 1157 of file ModuleMap.cpp.

References clang::Module::UnresolvedHeaders.

## ◆ resolveLinkAsDependencies()

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 59 of file ModuleMap.cpp.

References clang::Module::Name.

## ◆ resolveUses()

bool ModuleMap::resolveUses | ( | Module * | Mod,
|  | bool | Complain
| ) |  |

Resolve all of the unresolved uses in the given module.

Parameters

  Mod | The module whose uses should be resolved.
  Complain | Whether to emit diagnostics for failures.

Returns
  true if any errors were encountered while resolving uses, false otherwise.

Definition at line 1262 of file ModuleMap.cpp.

References clang::Module::DirectUses, and clang::Module::UnresolvedDirectUses.

Referenced by diagnoseHeaderInclusion(), clang::Preprocessor::EnterSubmodule(), and suggestModule().

## ◆ setBuiltinIncludeDir()

void clang::ModuleMap::setBuiltinIncludeDir | ( | const DirectoryEntry * | Dir | ) |
| inline

Set the directory that contains Clang-supplied include files, such as our stdarg.h or tgmath.h.

Definition at line 401 of file ModuleMap.h.

Referenced by clang::ApplyHeaderSearchOptions().

## ◆ setInferredModuleAllowedBy()

void ModuleMap::setInferredModuleAllowedBy | ( | Module * | M,
|  | const FileEntry * | ModMap
| ) |  |

Definition at line 1222 of file ModuleMap.cpp.

References clang::Module::IsInferred.

Referenced by prepareToBuildModule().

## ◆ setTarget()

void ModuleMap::setTarget | ( | const TargetInfo & | Target | ) |

Set the target information.

Definition at line 329 of file ModuleMap.cpp.

Referenced by clang::HeaderSearch::setTarget().

## ◆ setUmbrellaDir()

void ModuleMap::setUmbrellaDir | ( | Module * | Mod,
|  | const DirectoryEntry * | UmbrellaDir,
|  | Twine | NameAsWritten
| ) |  |

Sets the umbrella directory of the given module to the given directory.

Definition at line 1098 of file ModuleMap.cpp.

References clang::Module::UnresolvedHeaderDirective::HasBuiltinHeader, headerKindToRole(), headerRoleToKind(), clang::Module::HK_Excluded, clang::Module::UnresolvedHeaderDirective::IsUmbrella, clang::Module::UnresolvedHeaderDirective::Kind, clang::Module::UnresolvedHeaderDirective::ModTime, clang::Module::UnresolvedHeaderDirective::Size, TextualHeader, clang::Module::Umbrella, clang::Module::UmbrellaAsWritten, and clang::Module::UnresolvedHeaders.

## ◆ setUmbrellaHeader()

void ModuleMap::setUmbrellaHeader | ( | Module * | Mod,
|  | const FileEntry * | UmbrellaHeader,
|  | Twine | NameAsWritten
| ) |  |

Sets the umbrella header of the given module to the given header.

Definition at line 1086 of file ModuleMap.cpp.

References clang::FileEntry::getDir(), clang::SourceManager::getFileManager(), NormalHeader, clang::Module::Umbrella, and clang::Module::UmbrellaAsWritten.

## Friends And Related Function Documentation

## ◆ ModuleMapParser

friend class ModuleMapParser
| friend

Definition at line 192 of file ModuleMap.h.

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

- include/clang/Lex/ModuleMap.h
- lib/Lex/ModuleMap.cpp