clang 10.0.0git

Public Member Functions | List of all members
clang::ModuleDependencyCollector Class Reference

Collects the dependencies for imported modules into a directory. More...

`#include "clang/Frontend/Utils.h"`

Inheritance diagram for clang::ModuleDependencyCollector:
[legend]
Collaboration diagram for clang::ModuleDependencyCollector:
[legend]

## Public Member Functions
| ModuleDependencyCollector (std::string DestDir)
| ~ModuleDependencyCollector () override
StringRef | getDest ()
virtual bool | insertSeen (StringRef Filename)
virtual void | addFile (StringRef Filename, StringRef FileDst={})
virtual void | addFileMapping (StringRef VPath, StringRef RPath)
void | attachToPreprocessor (Preprocessor &PP) override
void | attachToASTReader (ASTReader &R) override
virtual void | writeFileMap ()
virtual bool | hasErrors ()
Public Member Functions inherited from clang::DependencyCollector
virtual | ~DependencyCollector ()
ArrayRef< std::string > | getDependencies () const
virtual bool | sawDependency (StringRef Filename, bool FromModule, bool IsSystem, bool IsModuleFile, bool IsMissing)
| Called when a new file is seen. More...
virtual void | finishedMainFile (DiagnosticsEngine &Diags)
| Called when the end of the main file is reached. More...
virtual bool | needSystemDependencies ()
| Return true if system files should be passed to sawDependency(). More...
virtual void | maybeAddDependency (StringRef Filename, bool FromModule, bool IsSystem, bool IsModuleFile, bool IsMissing)
| Add a dependency `Filename` if it has not been seen before and sawDependency() returns true. More...

## Additional Inherited Members
Protected Member Functions inherited from clang::DependencyCollector
bool | addDependency (StringRef Filename)
| Return true if the filename was added to the list of dependencies, false otherwise. More...

## Detailed Description

Collects the dependencies for imported modules into a directory.

Users should attach to the AST reader whenever a module is loaded.

Definition at line 149 of file Utils.h.

## Constructor & Destructor Documentation

## ◆ ModuleDependencyCollector()

clang::ModuleDependencyCollector::ModuleDependencyCollector | ( | std::string | DestDir | ) |
| inline

Definition at line 160 of file Utils.h.

## ◆ ~ModuleDependencyCollector()

clang::ModuleDependencyCollector::~ModuleDependencyCollector | ( |  | ) |
| inline override

Definition at line 162 of file Utils.h.

## Member Function Documentation

## ◆ addFile()

void ModuleDependencyCollector::addFile | ( | StringRef | Filename,
|  | StringRef | FileDst = `{}`
| ) |  |
| virtual

Definition at line 236 of file ModuleDependencyCollector.cpp.

## ◆ addFileMapping()

virtual void clang::ModuleDependencyCollector::addFileMapping | ( | StringRef | VPath,
|  | StringRef | RPath
| ) |  |
| inline virtual

Definition at line 168 of file Utils.h.

## ◆ attachToASTReader()

void ModuleDependencyCollector::attachToASTReader | ( | ASTReader & | R | ) |
| override virtual

Reimplemented from clang::DependencyCollector.

Definition at line 101 of file ModuleDependencyCollector.cpp.

References clang::ASTReader::addListener().

## ◆ attachToPreprocessor()

void ModuleDependencyCollector::attachToPreprocessor | ( | Preprocessor & | PP | ) |
| override virtual

Reimplemented from clang::DependencyCollector.

Definition at line 105 of file ModuleDependencyCollector.cpp.

References clang::ModuleMap::addModuleMapCallbacks(), clang::Preprocessor::addPPCallbacks(), clang::Preprocessor::getHeaderSearchInfo(), clang::HeaderSearch::getModuleMap(), and clang::Preprocessor::getSourceManager().

## ◆ getDest()

StringRef clang::ModuleDependencyCollector::getDest | ( |  | ) |
| inline

Definition at line 164 of file Utils.h.

## ◆ hasErrors()

virtual bool clang::ModuleDependencyCollector::hasErrors | ( |  | ) |
| inline virtual

Definition at line 176 of file Utils.h.

References clang::AttachDependencyGraphGen(), clang::AttachHeaderIncludeGen(), clang::createChainedIncludesSource(), clang::createInvocationFromCommandLine(), and clang::FrontendTimesIsEnabled.

## ◆ insertSeen()

virtual bool clang::ModuleDependencyCollector::insertSeen | ( | StringRef | Filename | ) |
| inline virtual

Definition at line 165 of file Utils.h.

References Filename.

## ◆ writeFileMap()

void ModuleDependencyCollector::writeFileMap | ( |  | ) |
| virtual

Definition at line 130 of file ModuleDependencyCollector.cpp.

References isCaseSensitivePath(), and clang::Result.

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

- include/clang/Frontend/Utils.h
- lib/Frontend/ModuleDependencyCollector.cpp