class DependencyCollector

Declaration

class DependencyCollector { /* full declaration omitted */ };

Description

An interface for collecting the dependencies of a compilation. Users should use \c attachToPreprocessor and \c attachToASTReader to get all of the dependencies. FIXME: Migrate DependencyGraphGen to use this interface.

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

Member Variables

private llvm::StringSet<> Seen
private std::vector<std::string> Dependencies

Method Overview

Methods

bool addDependency(llvm::StringRef Filename)

Description

Return true if the filename was added to the list of dependencies, false otherwise.

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

Parameters

llvm::StringRef Filename

virtual void attachToASTReader(
    clang::ASTReader& R)

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

Parameters

clang::ASTReader& R

virtual void attachToPreprocessor(
    clang::Preprocessor& PP)

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

Parameters

clang::Preprocessor& PP

virtual void finishedMainFile(
    clang::DiagnosticsEngine& Diags)

Description

Called when the end of the main file is reached.

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

Parameters

clang::DiagnosticsEngine& Diags

ArrayRef<std::string> getDependencies() const

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

virtual void maybeAddDependency(
    llvm::StringRef Filename,
    bool FromModule,
    bool IsSystem,
    bool IsModuleFile,
    bool IsMissing)

Description

Add a dependency \p Filename if it has not been seen before and sawDependency() returns true.

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

Parameters

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

virtual bool needSystemDependencies()

Description

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

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

virtual 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:73

Parameters

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

virtual ~DependencyCollector()

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