class ModuleDepCollectorPP
Declaration
class ModuleDepCollectorPP : public PPCallbacks { /* full declaration omitted */ };
Description
Callback that records textual includes and direct modular includes/imports during preprocessing. At the end of the main file, it also collects transitive modular dependencies and passes everything to the\c DependencyConsumer of the parent \c ModuleDepCollector.
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:151
Inherits from: PPCallbacks
Member Variables
- private clang::tooling::dependencies::ModuleDepCollector& MDC
- The parent dependency collector.
- private llvm::SetVector<const Module*> DirectModularDeps
- Working set of direct modular dependencies.
- private llvm::SetVector<const Module*> DirectPrebuiltModularDeps
- Working set of direct modular dependencies that have already been built.
Method Overview
- public void EndOfMainFile()
- public void FileChanged(clang::SourceLocation Loc, clang::PPCallbacks::FileChangeReason Reason, SrcMgr::CharacteristicKind FileType, clang::FileID PrevFID)
- public void InclusionDirective(clang::SourceLocation HashLoc, const clang::Token & IncludeTok, llvm::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange, Optional<clang::FileEntryRef> File, llvm::StringRef SearchPath, llvm::StringRef RelativePath, const clang::Module * Imported, SrcMgr::CharacteristicKind FileType)
- public ModuleDepCollectorPP(clang::tooling::dependencies::ModuleDepCollector & MDC)
- private void addAllSubmoduleDeps(const clang::Module * M, clang::tooling::dependencies::ModuleDeps & MD, llvm::DenseSet<const Module *> & AddedModules)
- private void addAllSubmodulePrebuiltDeps(const clang::Module * M, clang::tooling::dependencies::ModuleDeps & MD, llvm::DenseSet<const Module *> & SeenSubmodules)
- private void addModuleDep(const clang::Module * M, clang::tooling::dependencies::ModuleDeps & MD, llvm::DenseSet<const Module *> & AddedModules)
- private void addModulePrebuiltDeps(const clang::Module * M, clang::tooling::dependencies::ModuleDeps & MD, llvm::DenseSet<const Module *> & SeenSubmodules)
- private void handleImport(const clang::Module * Imported)
- private clang::tooling::dependencies::ModuleID handleTopLevelModule(const clang::Module * M)
- public void moduleImport(clang::SourceLocation ImportLoc, clang::ModuleIdPath Path, const clang::Module * Imported)
Inherited from PPCallbacks:
- public Defined
- public Elif
- public Elifdef
- public Elifdef
- public Elifndef
- public Elifndef
- public Else
- public EndOfMainFile
- public Endif
- public EnteredSubmodule
- public FileChanged
- public FileSkipped
- public HasInclude
- public Ident
- public If
- public Ifdef
- public Ifndef
- public InclusionDirective
- public LeftSubmodule
- public LexedFileChanged
- public MacroDefined
- public MacroExpands
- public MacroUndefined
- public PragmaAssumeNonNullBegin
- public PragmaAssumeNonNullEnd
- public PragmaComment
- public PragmaDebug
- public PragmaDetectMismatch
- public PragmaDiagnostic
- public PragmaDiagnosticPop
- public PragmaDiagnosticPush
- public PragmaDirective
- public PragmaExecCharsetPop
- public PragmaExecCharsetPush
- public PragmaMark
- public PragmaMessage
- public PragmaOpenCLExtension
- public PragmaWarning
- public PragmaWarningPop
- public PragmaWarningPush
- public SourceRangeSkipped
- public moduleImport
Methods
¶void EndOfMainFile()
void EndOfMainFile()
Description
Callback invoked when the end of the main file is reached. No subsequent callbacks will be made.
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:167
¶void FileChanged(
clang::SourceLocation Loc,
clang::PPCallbacks::FileChangeReason Reason,
SrcMgr::CharacteristicKind FileType,
clang::FileID PrevFID)
void FileChanged(
clang::SourceLocation Loc,
clang::PPCallbacks::FileChangeReason Reason,
SrcMgr::CharacteristicKind FileType,
clang::FileID PrevFID)
Description
Callback invoked whenever a source file is entered or exited.
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:155
Parameters
- clang::SourceLocation Loc
- Indicates the new location.
- clang::PPCallbacks::FileChangeReason Reason
- SrcMgr::CharacteristicKind FileType
- clang::FileID PrevFID
- the file that was exited if \p Reason is ExitFile or the the file before the new one entered for \p Reason EnterFile.
¶void InclusionDirective(
clang::SourceLocation HashLoc,
const clang::Token& IncludeTok,
llvm::StringRef FileName,
bool IsAngled,
clang::CharSourceRange FilenameRange,
Optional<clang::FileEntryRef> File,
llvm::StringRef SearchPath,
llvm::StringRef RelativePath,
const clang::Module* Imported,
SrcMgr::CharacteristicKind FileType)
void InclusionDirective(
clang::SourceLocation HashLoc,
const clang::Token& IncludeTok,
llvm::StringRef FileName,
bool IsAngled,
clang::CharSourceRange FilenameRange,
Optional<clang::FileEntryRef> File,
llvm::StringRef SearchPath,
llvm::StringRef RelativePath,
const clang::Module* Imported,
SrcMgr::CharacteristicKind FileType)
Description
Callback invoked whenever an inclusion directive of any kind (\c \#include \c \#import etc.) has been processed, regardless of whether the inclusion will actually result in an inclusion.
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:158
Parameters
- clang::SourceLocation HashLoc
- The location of the '#' that starts the inclusion directive.
- const clang::Token& IncludeTok
- The token that indicates the kind of inclusion directive, e.g., 'include' or 'import'.
- llvm::StringRef FileName
- The name of the file being included, as written in the source code.
- bool IsAngled
- Whether the file name was enclosed in angle brackets; otherwise, it was enclosed in quotes.
- clang::CharSourceRange FilenameRange
- The character range of the quotes or angle brackets for the written file name.
- Optional<clang::FileEntryRef> File
- The actual file that may be included by this inclusion directive.
- llvm::StringRef SearchPath
- Contains the search path which was used to find the file in the file system. If the file was found via an absolute include path, SearchPath will be empty. For framework includes, the SearchPath and RelativePath will be split up. For example, if an include of "Some/Some.h" is found via the framework path "path/to/Frameworks/Some.framework/Headers/Some.h", SearchPath will be "path/to/Frameworks/Some.framework/Headers" and RelativePath will be "Some.h".
- llvm::StringRef RelativePath
- The path relative to SearchPath, at which the include file was found. This is equal to FileName except for framework includes.
- const clang::Module* Imported
- The module, whenever an inclusion directive was automatically turned into a module import or null otherwise.
- SrcMgr::CharacteristicKind FileType
- The characteristic kind, indicates whether a file or directory holds normal user code, system code, or system code which is implicitly 'extern "C"' in C++ mode.
¶ModuleDepCollectorPP(
clang::tooling::dependencies::
ModuleDepCollector& MDC)
ModuleDepCollectorPP(
clang::tooling::dependencies::
ModuleDepCollector& MDC)
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:153
Parameters
¶void addAllSubmoduleDeps(
const clang::Module* M,
clang::tooling::dependencies::ModuleDeps& MD,
llvm::DenseSet<const Module*>& AddedModules)
void addAllSubmoduleDeps(
const clang::Module* M,
clang::tooling::dependencies::ModuleDeps& MD,
llvm::DenseSet<const Module*>& AddedModules)
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:191
Parameters
- const clang::Module* M
- clang::tooling::dependencies::ModuleDeps& MD
- llvm::DenseSet<const Module*>& AddedModules
¶void addAllSubmodulePrebuiltDeps(
const clang::Module* M,
clang::tooling::dependencies::ModuleDeps& MD,
llvm::DenseSet<const Module*>& SeenSubmodules)
void addAllSubmodulePrebuiltDeps(
const clang::Module* M,
clang::tooling::dependencies::ModuleDeps& MD,
llvm::DenseSet<const Module*>& SeenSubmodules)
Description
Adds direct modular dependencies that have already been built to the ModuleDeps instance.
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:182
Parameters
- const clang::Module* M
- clang::tooling::dependencies::ModuleDeps& MD
- llvm::DenseSet<const Module*>& SeenSubmodules
¶void addModuleDep(
const clang::Module* M,
clang::tooling::dependencies::ModuleDeps& MD,
llvm::DenseSet<const Module*>& AddedModules)
void addModuleDep(
const clang::Module* M,
clang::tooling::dependencies::ModuleDeps& MD,
llvm::DenseSet<const Module*>& AddedModules)
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:193
Parameters
- const clang::Module* M
- clang::tooling::dependencies::ModuleDeps& MD
- llvm::DenseSet<const Module*>& AddedModules
¶void addModulePrebuiltDeps(
const clang::Module* M,
clang::tooling::dependencies::ModuleDeps& MD,
llvm::DenseSet<const Module*>& SeenSubmodules)
void addModulePrebuiltDeps(
const clang::Module* M,
clang::tooling::dependencies::ModuleDeps& MD,
llvm::DenseSet<const Module*>& SeenSubmodules)
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:184
Parameters
- const clang::Module* M
- clang::tooling::dependencies::ModuleDeps& MD
- llvm::DenseSet<const Module*>& SeenSubmodules
¶void handleImport(const clang::Module* Imported)
void handleImport(const clang::Module* Imported)
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:177
Parameters
- const clang::Module* Imported
¶clang::tooling::dependencies::ModuleID
handleTopLevelModule(const clang::Module* M)
clang::tooling::dependencies::ModuleID
handleTopLevelModule(const clang::Module* M)
Description
Traverses the previously collected direct modular dependencies to discover transitive modular dependencies and fills the parent \c ModuleDepCollector with both.
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:190
Parameters
- const clang::Module* M
¶void moduleImport(clang::SourceLocation ImportLoc,
clang::ModuleIdPath Path,
const clang::Module* Imported)
void moduleImport(clang::SourceLocation ImportLoc,
clang::ModuleIdPath Path,
const clang::Module* Imported)
Description
Callback invoked whenever there was an explicit module-import syntax.
Declared at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:164
Parameters
- clang::SourceLocation ImportLoc
- The location of import directive token.
- clang::ModuleIdPath Path
- The identifiers (and their locations) of the module "path", e.g., "std.vector" would be split into "std" and "vector".
- const clang::Module* Imported
- The imported module; can be null if importing failed.