9#ifndef LLVM_CLANG_TOOLING_DEPENDENCYSCANNING_MODULEDEPCOLLECTOR_H
10#define LLVM_CLANG_TOOLING_DEPENDENCYSCANNING_MODULEDEPCOLLECTOR_H
19#include "llvm/ADT/DenseMap.h"
20#include "llvm/ADT/StringSet.h"
21#include "llvm/Support/raw_ostream.h"
24#include <unordered_map>
28namespace dependencies {
30class DependencyConsumer;
133 StringRef FileName,
bool IsAngled,
136 StringRef RelativePath,
const Module *Imported,
139 const Module *Imported)
override;
147 llvm::SetVector<const Module *> DirectModularDeps;
149 void handleImport(
const Module *Imported);
163 std::optional<ModuleID> handleTopLevelModule(
const Module *M);
184 bool EagerLoadModules);
201 std::string MainFile;
203 std::string ContextHash;
206 std::vector<std::string> FileDeps;
208 llvm::MapVector<const Module *, std::unique_ptr<ModuleDeps>> ModularDeps;
211 llvm::DenseMap<ModuleID, ModuleDeps *> ModuleDepsByID;
213 llvm::MapVector<const Module *, PrebuiltModuleDep> DirectPrebuiltModularDeps;
215 std::unique_ptr<DependencyOutputOptions> Opts;
221 bool EagerLoadModules;
224 bool isPrebuiltModule(
const Module *M);
227 void addFileDep(StringRef Path);
229 void addFileDep(
ModuleDeps &MD, StringRef Path);
262template <>
struct DenseMapInfo<
clang::tooling::dependencies::ModuleID> {
269 return hash_combine(ID.ModuleName, ID.ContextHash);
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the PPCallbacks interface.
static std::string getName(const CallEvent &Call)
Defines the SourceManager interface.
Reads an AST files chain containing the contents of a translation unit.
Represents a character-granular source range.
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
Helper class for holding the data necessary to invoke the compiler.
An interface for collecting the dependencies of a compilation.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Record the location of an inclusion directive, such as an #include or #import statement.
Describes a module or submodule.
This interface provides a way to observe the actions of the preprocessor as it does its thing.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
Encodes a location in the source.
Token - This structure provides full information about a lexed token.
CharacteristicKind
Indicates whether a file or directory holds normal user code, system code, or system code which is im...
@ C
Languages that the frontend can parse and compile.
YAML serialization mapping.