clang 20.0.0git
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 , ExcludedHeader = 0x4 }
 Flags describing the role of a module header. More...
 
using AdditionalModMapsSet = llvm::DenseSet< FileEntryRef >
 
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 (DirectoryEntryRef Dir)
 Set the directory that contains Clang-supplied include files, such as our stdarg.h or tgmath.h.
 
OptionalDirectoryEntryRef getBuiltinDir () const
 Get the directory that contains Clang-supplied include files.
 
bool isBuiltinHeader (FileEntryRef File)
 Is this a compiler builtin header?
 
bool shouldImportRelativeToBuiltinIncludeDir (StringRef FileName, Module *Module) const
 
void addModuleMapCallbacks (std::unique_ptr< ModuleMapCallbacks > Callback)
 Add a module map callback.
 
KnownHeader findModuleForHeader (FileEntryRef File, bool AllowTextual=false, bool AllowExcluded=false)
 Retrieve the module that owns the given header file, if any.
 
ArrayRef< KnownHeaderfindAllModulesForHeader (FileEntryRef File)
 Retrieve all the modules that contain the given header file.
 
ArrayRef< KnownHeaderfindResolvedModulesForHeader (FileEntryRef 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 (FileEntryRef Header) const
 Determine whether the given header is part of a module marked 'unavailable'.
 
bool isHeaderUnavailableInModule (FileEntryRef Header, const Module *RequestingModule) const
 Determine whether the given header is unavailable as part of the specified module.
 
ModulefindModule (StringRef Name) const
 Retrieve a module with the given name.
 
ModulefindOrInferSubmodule (Module *Parent, StringRef Name)
 
ModulelookupModuleUnqualified (StringRef Name, Module *Context) const
 Retrieve a module with the given name using lexical name lookup, starting at the given context.
 
ModulelookupModuleQualified (StringRef Name, Module *Context) const
 Retrieve a module with the given name within the given context, using direct (qualified) name lookup.
 
std::pair< Module *, boolfindOrCreateModule (StringRef Name, Module *Parent, bool IsFramework, bool IsExplicit)
 Find a new module or submodule, or create it if it does not already exist.
 
ModulefindOrCreateModuleFirst (StringRef Name, Module *Parent, bool IsFramework, bool IsExplicit)
 Call ModuleMap::findOrCreateModule and throw away the information whether the module was found or created.
 
ModulecreateModule (StringRef Name, Module *Parent, bool IsFramework, bool IsExplicit)
 Create new submodule, assuming it does not exist.
 
ModulecreateGlobalModuleFragmentForModuleUnit (SourceLocation Loc, Module *Parent=nullptr)
 Create a global module fragment for a C++ module unit.
 
ModulecreateImplicitGlobalModuleFragmentForModuleUnit (SourceLocation Loc, Module *Parent)
 
ModulecreatePrivateModuleFragmentForInterfaceUnit (Module *Parent, SourceLocation Loc)
 Create a global module fragment for a C++ module interface unit.
 
ModulecreateModuleUnitWithKind (SourceLocation Loc, StringRef Name, Module::ModuleKind Kind)
 Create a new C++ module with the specified kind, and reparent any pending global module fragment(s) to it.
 
Module