clang
9.0.0
|
Builds a dependency file when attached to a Preprocessor (for includes) and ASTReader (for module imports), and writes it out at the end of processing a source file. More...
#include "clang/Frontend/Utils.h"
Public Member Functions | |
DependencyFileGenerator (const DependencyOutputOptions &Opts) | |
void | attachToPreprocessor (Preprocessor &PP) override |
void | finishedMainFile (DiagnosticsEngine &Diags) override |
Called when the end of the main file is reached. More... | |
bool | needSystemDependencies () final override |
Return true if system files should be passed to sawDependency(). More... | |
bool | sawDependency (StringRef Filename, bool FromModule, bool IsSystem, bool IsModuleFile, bool IsMissing) final override |
Called when a new file is seen. More... | |
![]() | |
virtual | ~DependencyCollector () |
virtual void | attachToASTReader (ASTReader &R) |
ArrayRef< std::string > | getDependencies () const |
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... | |
Protected Member Functions | |
void | outputDependencyFile (llvm::raw_ostream &OS) |
![]() | |
bool | addDependency (StringRef Filename) |
Return true if the filename was added to the list of dependencies, false otherwise. More... | |
Builds a dependency file when attached to a Preprocessor (for includes) and ASTReader (for module imports), and writes it out at the end of processing a source file.
Users should attach to the ast reader whenever a module is loaded.
DependencyFileGenerator::DependencyFileGenerator | ( | const DependencyOutputOptions & | Opts | ) |
Definition at line 180 of file DependencyFile.cpp.
References clang::DependencyCollector::addDependency(), and clang::DependencyOutputOptions::ExtraDeps.
|
overridevirtual |
Reimplemented from clang::DependencyCollector.
Definition at line 194 of file DependencyFile.cpp.
References clang::DependencyCollector::attachToPreprocessor(), clang::Preprocessor::getDiagnostics(), clang::DiagnosticsEngine::Report(), and clang::Preprocessor::SetSuppressIncludeNotFoundError().
|
overridevirtual |
Called when the end of the main file is reached.
Reimplemented from clang::DependencyCollector.
Definition at line 229 of file DependencyFile.cpp.
References outputDependencyFile().
|
inlinefinaloverridevirtual |
Return true if system files should be passed to sawDependency().
Reimplemented from clang::DependencyCollector.
Definition at line 130 of file Utils.h.
References Filename.
|
protected |
Definition at line 328 of file DependencyFile.cpp.
References clang::DependencyCollector::getDependencies(), PrintFilename(), and clang::Target.
Referenced by finishedMainFile(), and PrintFilename().
|
finaloverridevirtual |
Called when a new file is seen.
Return true if Filename
should be added to the list of dependencies.
The default implementation ignores <built-in> and system files.
Reimplemented from clang::DependencyCollector.
Definition at line 207 of file DependencyFile.cpp.
References isSpecialFilename().