class ModuleMapParser
Declaration
class ModuleMapParser { /* full declaration omitted */ };
Declared at: clang/lib/Lex/ModuleMap.cpp:1435
Member Variables
- private clang::Lexer& L
- private clang::SourceManager& SourceMgr
- private const clang::TargetInfo* Target
- Default target information, used only for string literal parsing.
- private clang::DiagnosticsEngine& Diags
- private clang::ModuleMap& Map
- private const clang::FileEntry* ModuleMapFile
- The current module map file.
- private clang::SourceLocation CurrModuleDeclLoc
- Source location of most recent parsed module declaration
- private const clang::DirectoryEntry* Directory
- The directory that file names in this module map file should be resolved relative to.
- private bool IsSystem
- Whether this module map is in a system header directory.
- private bool HadError = false
- Whether an error occurred.
- private llvm::BumpPtrAllocator StringData
- Stores string data for the various string literals referenced during parsing.
- private clang::MMToken Tok
- The current token.
- private clang::Module* ActiveModule = nullptr
- The active module.
- private llvm::SmallPtrSet<Module*, 2> UsesRequiresExcludedHack
- On older Darwin SDK versions, 'requires excluded' is used to mark the contents of the Darwin.C.excluded (assert.h) and Tcl.Private modules as non-modular headers. For backwards compatibility, we continue to support this idiom for just these modules, and map the headers to 'textual' to match the original intent.
Method Overview
- public ModuleMapParser(clang::Lexer & L, clang::SourceManager & SourceMgr, const clang::TargetInfo * Target, clang::DiagnosticsEngine & Diags, clang::ModuleMap & Map, const clang::FileEntry * ModuleMapFile, const clang::DirectoryEntry * Directory, bool IsSystem)
- private clang::SourceLocation consumeToken()
- private void diagnosePrivateModules(clang::SourceLocation ExplicitLoc, clang::SourceLocation FrameworkLoc)
- public clang::SourceLocation getLocation()
- private void parseConfigMacros()
- private void parseConflict()
- private void parseExportAsDecl()
- private void parseExportDecl()
- private void parseExternModuleDecl()
- private void parseHeaderDecl(MMToken::TokenKind, clang::SourceLocation LeadingLoc)
- private void parseInferredModuleDecl(bool Framework, bool Explicit)
- private void parseLinkDecl()
- private void parseModuleDecl()
- private bool parseModuleId(clang::ModuleMapParser::ModuleId & Id)
- public bool parseModuleMapFile()
- private bool parseOptionalAttributes(clang::ModuleMapParser::Attributes & Attrs)
- private void parseRequiresDecl()
- private void parseUmbrellaDirDecl(clang::SourceLocation UmbrellaLoc)
- private void parseUseDecl()
- private void skipUntil(MMToken::TokenKind K)
- public bool terminatedByDirective()
Methods
¶ModuleMapParser(
clang::Lexer& L,
clang::SourceManager& SourceMgr,
const clang::TargetInfo* Target,
clang::DiagnosticsEngine& Diags,
clang::ModuleMap& Map,
const clang::FileEntry* ModuleMapFile,
const clang::DirectoryEntry* Directory,
bool IsSystem)
ModuleMapParser(
clang::Lexer& L,
clang::SourceManager& SourceMgr,
const clang::TargetInfo* Target,
clang::DiagnosticsEngine& Diags,
clang::ModuleMap& Map,
const clang::FileEntry* ModuleMapFile,
const clang::DirectoryEntry* Directory,
bool IsSystem)
Declared at: clang/lib/Lex/ModuleMap.cpp:1517
Parameters
- clang::Lexer& L
- clang::SourceManager& SourceMgr
- const clang::TargetInfo* Target
- clang::DiagnosticsEngine& Diags
- clang::ModuleMap& Map
- const clang::FileEntry* ModuleMapFile
- const clang::DirectoryEntry* Directory
- bool IsSystem
¶clang::SourceLocation consumeToken()
clang::SourceLocation consumeToken()
Description
Consume the current token and return its location.
Declared at: clang/lib/Lex/ModuleMap.cpp:1483
¶void diagnosePrivateModules(
clang::SourceLocation ExplicitLoc,
clang::SourceLocation FrameworkLoc)
void diagnosePrivateModules(
clang::SourceLocation ExplicitLoc,
clang::SourceLocation FrameworkLoc)
Description
Private modules are canonicalized as Foo_Private. Clang provides extra module map search logic to find the appropriate private module when PCH is used with implicit module maps. Warn when private modules are written in other ways (FooPrivate and Foo.Private), providing notes and fixits.
Declared at: clang/lib/Lex/ModuleMap.cpp:1509
Parameters
- clang::SourceLocation ExplicitLoc
- clang::SourceLocation FrameworkLoc
¶clang::SourceLocation getLocation()
clang::SourceLocation getLocation()
Declared at: clang/lib/Lex/ModuleMap.cpp:1531
¶void parseConfigMacros()
void parseConfigMacros()
Description
Parse a configuration macro declaration. module-declaration: 'config_macros' attributes[opt] config-macro-list? config-macro-list: identifier (',' identifier)?
Declared at: clang/lib/Lex/ModuleMap.cpp:1501
¶void parseConflict()
void parseConflict()
Description
Parse a conflict declaration. module-declaration: 'conflict' module-id ',' string-literal
Declared at: clang/lib/Lex/ModuleMap.cpp:1502
¶void parseExportAsDecl()
void parseExportAsDecl()
Description
Parse a module export_as declaration. export-as-declaration: 'export_as' identifier
Declared at: clang/lib/Lex/ModuleMap.cpp:1498
¶void parseExportDecl()
void parseExportDecl()
Description
Parse a module export declaration. export-declaration: 'export' wildcard-module-id wildcard-module-id: identifier '*' identifier '.' wildcard-module-id
Declared at: clang/lib/Lex/ModuleMap.cpp:1497
¶void parseExternModuleDecl()
void parseExternModuleDecl()
Description
Parse an extern module declaration. extern module-declaration: 'extern' 'module' module-id string-literal
Declared at: clang/lib/Lex/ModuleMap.cpp:1493
¶void parseHeaderDecl(
MMToken::TokenKind,
clang::SourceLocation LeadingLoc)
void parseHeaderDecl(
MMToken::TokenKind,
clang::SourceLocation LeadingLoc)
Description
Parse a header declaration. header-declaration: 'textual'[opt] 'header' string-literal 'private' 'textual'[opt] 'header' string-literal 'exclude' 'header' string-literal 'umbrella' 'header' string-literal FIXME: Support 'private textual header'.
Declared at: clang/lib/Lex/ModuleMap.cpp:1495
Parameters
- MMToken::TokenKind
- clang::SourceLocation LeadingLoc
¶void parseInferredModuleDecl(bool Framework,
bool Explicit)
void parseInferredModuleDecl(bool Framework,
bool Explicit)
Description
Parse an inferred module declaration (wildcard modules). module-declaration: 'explicit'[opt] 'framework'[opt] 'module' * attributes[opt] { inferred-module-member* } inferred-module-member: 'export' '*' 'exclude' identifier
Declared at: clang/lib/Lex/ModuleMap.cpp:1503
Parameters
- bool Framework
- bool Explicit
¶void parseLinkDecl()
void parseLinkDecl()
Description
Parse a link declaration. module-declaration: 'link' 'framework'[opt] string-literal
Declared at: clang/lib/Lex/ModuleMap.cpp:1500
¶void parseModuleDecl()
void parseModuleDecl()
Description
Parse a module declaration. module-declaration: 'extern' 'module' module-id string-literal 'explicit'[opt] 'framework'[opt] 'module' module-id attributes[opt] { module-member* } module-member: requires-declaration header-declaration submodule-declaration export-declaration export-as-declaration link-declaration submodule-declaration: module-declaration inferred-submodule-declaration
Declared at: clang/lib/Lex/ModuleMap.cpp:1492
¶bool parseModuleId(
clang::ModuleMapParser::ModuleId& Id)
bool parseModuleId(
clang::ModuleMapParser::ModuleId& Id)
Description
Parse a module-id. module-id: identifier identifier '.' module-id
Declared at: clang/lib/Lex/ModuleMap.cpp:1491
Parameters
Returns
true if an error occurred, false otherwise.
¶bool parseModuleMapFile()
bool parseModuleMapFile()
Description
Parse a module map file. module-map-file: module-declaration*
Declared at: clang/lib/Lex/ModuleMap.cpp:1528
¶bool parseOptionalAttributes(
clang::ModuleMapParser::Attributes& Attrs)
bool parseOptionalAttributes(
clang::ModuleMapParser::Attributes& Attrs)
Description
Parse optional attributes. attributes: attribute attributes attribute attribute: [ identifier ]
Declared at: clang/lib/Lex/ModuleMap.cpp:1514
Parameters
- clang::ModuleMapParser::Attributes& Attrs
- Will be filled in with the parsed attributes.
Returns
true if an error occurred, false otherwise.
¶void parseRequiresDecl()
void parseRequiresDecl()
Description
Parse a requires declaration. requires-declaration: 'requires' feature-list feature-list: feature ',' feature-list feature feature: '!'[opt] identifier
Declared at: clang/lib/Lex/ModuleMap.cpp:1494
¶void parseUmbrellaDirDecl(
clang::SourceLocation UmbrellaLoc)
void parseUmbrellaDirDecl(
clang::SourceLocation UmbrellaLoc)
Description
Parse an umbrella directory declaration. umbrella-dir-declaration: umbrella string-literal
Declared at: clang/lib/Lex/ModuleMap.cpp:1496
Parameters
- clang::SourceLocation UmbrellaLoc
¶void parseUseDecl()
void parseUseDecl()
Description
Parse a module use declaration. use-declaration: 'use' wildcard-module-id
Declared at: clang/lib/Lex/ModuleMap.cpp:1499
¶void skipUntil(MMToken::TokenKind K)
void skipUntil(MMToken::TokenKind K)
Description
Skip tokens until we reach the a token with the given kind (or the end of the file).
Declared at: clang/lib/Lex/ModuleMap.cpp:1487
Parameters
- MMToken::TokenKind K
¶bool terminatedByDirective()
bool terminatedByDirective()
Declared at: clang/lib/Lex/ModuleMap.cpp:1530