clang 20.0.0git
|
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. | |
bool | needSystemDependencies () final |
Return true if system files should be passed to sawDependency(). | |
bool | sawDependency (StringRef Filename, bool FromModule, bool IsSystem, bool IsModuleFile, bool IsMissing) final |
Called when a new file is seen. | |
Public Member Functions inherited from clang::DependencyCollector | |
virtual | ~DependencyCollector () |
virtual void | attachToPreprocessor (Preprocessor &PP) |
virtual void | attachToASTReader (ASTReader &R) |
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. | |
virtual void | finishedMainFile (DiagnosticsEngine &Diags) |
Called when the end of the main file is reached. | |
virtual bool | needSystemDependencies () |
Return true if system files should be passed to sawDependency(). | |
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. | |
Protected Member Functions | |
void | outputDependencyFile (llvm::raw_ostream &OS) |
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. | |
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 219 of file DependencyFile.cpp.
References clang::DependencyCollector::addDependency(), and clang::DependencyOutputOptions::ExtraDeps.
|
overridevirtual |
Reimplemented from clang::DependencyCollector.
Definition at line 233 of file DependencyFile.cpp.
References clang::DependencyCollector::attachToPreprocessor(), and clang::Preprocessor::SetSuppressIncludeNotFoundError().
|
overridevirtual |
Called when the end of the main file is reached.
Reimplemented from clang::DependencyCollector.
Definition at line 263 of file DependencyFile.cpp.
References outputDependencyFile().
|
inlinefinalvirtual |
Return true if system files should be passed to sawDependency().
Reimplemented from clang::DependencyCollector.
|
protected |
Definition at line 362 of file DependencyFile.cpp.
References E, clang::File, clang::DependencyCollector::getDependencies(), PrintFilename(), and clang::Target.
Referenced by finishedMainFile().
|
finalvirtual |
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 241 of file DependencyFile.cpp.
References Filename, and isSpecialFilename().