class DependencyFileGenerator

Declaration

class DependencyFileGenerator : public DependencyCollector { /* full declaration omitted */ };

Description

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.

Declared at: clang/include/clang/Frontend/Utils.h:102

Inherits from: DependencyCollector

Member Variables

private std::string OutputFile
private std::vector<std::string> Targets
private bool IncludeSystemHeaders
private bool PhonyTarget
private bool AddMissingHeaderDeps
private bool SeenMissingHeader
private bool IncludeModuleFiles
private clang::DependencyOutputFormat OutputFormat
private unsigned int InputFileIndex

Method Overview

Inherited from DependencyCollector:

Methods

DependencyFileGenerator(
    const clang::DependencyOutputOptions& Opts)

Declared at: clang/include/clang/Frontend/Utils.h:104

Parameters

const clang::DependencyOutputOptions& Opts

void attachToPreprocessor(clang::Preprocessor& PP)

Declared at: clang/include/clang/Frontend/Utils.h:106

Parameters

clang::Preprocessor& PP

void finishedMainFile(
    clang::DiagnosticsEngine& Diags)

Description

Called when the end of the main file is reached.

Declared at: clang/include/clang/Frontend/Utils.h:108

Parameters

clang::DiagnosticsEngine& Diags

bool needSystemDependencies()

Description

Return true if system files should be passed to sawDependency().

Declared at: clang/include/clang/Frontend/Utils.h:110

void outputDependencyFile(llvm::raw_ostream& OS)

Declared at: clang/include/clang/Frontend/Utils.h:116

Parameters

llvm::raw_ostream& OS

void outputDependencyFile(
    clang::DiagnosticsEngine& Diags)

Declared at: clang/include/clang/Frontend/Utils.h:119

Parameters

clang::DiagnosticsEngine& Diags

bool sawDependency(llvm::StringRef Filename,
                   bool FromModule,
                   bool IsSystem,
                   bool IsModuleFile,
                   bool IsMissing)

Description

Called when a new file is seen. Return true if \p Filename should be added to the list of dependencies. The default implementation ignores <built -in> and system files.

Declared at: clang/include/clang/Frontend/Utils.h:112

Parameters

llvm::StringRef Filename
bool FromModule
bool IsSystem
bool IsModuleFile
bool IsMissing