9#ifndef LLVM_CLANG_TOOLING_DEPENDENCYSCANNING_MODULEDEPCOLLECTOR_H
10#define LLVM_CLANG_TOOLING_DEPENDENCYSCANNING_MODULEDEPCOLLECTOR_H
20#include "llvm/ADT/DenseMap.h"
21#include "llvm/ADT/Hashing.h"
22#include "llvm/ADT/StringSet.h"
23#include "llvm/Support/raw_ostream.h"
26#include <unordered_map>
31namespace dependencies {
33class DependencyActionController;
34class DependencyConsumer;
148 std::variant<std::monostate, CowCompilerInvocation, std::vector<std::string>>
169 StringRef RelativePath,
const Module *Imported,
172 const Module *Imported)
override;
180 void handleImport(
const Module *Imported);
194 std::optional<ModuleID> handleTopLevelModule(
const Module *M);
217 bool IsStdModuleP1689Format);
236 std::string MainFile;
238 std::string ContextHash;
241 std::vector<std::string> FileDeps;
243 llvm::MapVector<const Module *, std::unique_ptr<ModuleDeps>> ModularDeps;
246 llvm::DenseMap<ModuleID, ModuleDeps *> ModuleDepsByID;
248 llvm::MapVector<const Module *, PrebuiltModuleDep> DirectPrebuiltModularDeps;
250 llvm::SetVector<const Module *> DirectModularDeps;
252 std::unique_ptr<DependencyOutputOptions> Opts;
261 bool EagerLoadModules;
264 bool IsStdModuleP1689Format;
266 std::optional<P1689ModuleInfo> ProvidedStdCXXModule;
267 std::vector<P1689ModuleInfo> RequiredStdCXXModules;
270 bool isPrebuiltModule(
const Module *M);
273 void addFileDep(StringRef Path);
275 void addFileDep(
ModuleDeps &MD, StringRef Path);
311 return hash_combine(
ID.ModuleName,
ID.ContextHash);
314template <>
struct DenseMapInfo<
clang::tooling::dependencies::ModuleID> {
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.
Same as CompilerInvocation, but with copy-on-write optimization.
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.
The base class of the type hierarchy.
CharacteristicKind
Indicates whether a file or directory holds normal user code, system code, or system code which is im...
@ Other
Other implicit parameter.
YAML serialization mapping.
hash_code hash_value(const clang::tooling::dependencies::ModuleID &ID)