9#ifndef LLVM_CLANG_TOOLING_DEPENDENCYSCANNING_MODULEDEPCOLLECTOR_H
10#define LLVM_CLANG_TOOLING_DEPENDENCYSCANNING_MODULEDEPCOLLECTOR_H
21#include "llvm/ADT/DenseMap.h"
22#include "llvm/ADT/Hashing.h"
23#include "llvm/ADT/StringSet.h"
24#include "llvm/Support/raw_ostream.h"
27#include <unordered_map>
32namespace dependencies {
34class DependencyActionController;
35class DependencyConsumer;
36class PrebuiltModuleASTAttrs;
46 PCMFile(M->getASTFile()->getName()),
65 const llvm::StringSet<> &
getVFS()
const {
return VFSMap; }
86 llvm::StringSet<> VFSMap;
87 bool IsInStableDirs =
true;
88 std::set<StringRef> ModuleFileDependents;
109 std::tie(
Other.ModuleName,
Other.ContextHash);
114 std::tie(
Other.ModuleName,
Other.ContextHash);
194 void forEachFileDep(llvm::function_ref<
void(StringRef)> Cb)
const;
205 std::string FileDepsBaseDir;
209 std::vector<std::string> FileDeps;
212 std::vector<std::string>>
233 StringRef RelativePath,
const Module *SuggestedModule,
237 const Module *Imported)
override;
245 void handleImport(
const Module *Imported);
251 llvm::DenseSet<const Module *> &SeenSubmodules);
253 llvm::DenseSet<const Module *> &SeenSubmodules);
259 std::optional<ModuleID> handleTopLevelModule(
const Module *M);
261 llvm::DenseSet<const Module *> &AddedModules);
263 llvm::DenseSet<const Module *> &AddedModules);
268 llvm::DenseSet<const Module *> &AddedModules);
270 llvm::DenseSet<const Module *> &AddedModules);
281 std::unique_ptr<DependencyOutputOptions> Opts,
313 std::string MainFile;
316 std::vector<std::string> FileDeps;
318 llvm::MapVector<const Module *, std::unique_ptr<ModuleDeps>> ModularDeps;
321 llvm::DenseMap<ModuleID, ModuleDeps *> ModuleDepsByID;
323 llvm::MapVector<const Module *, PrebuiltModuleDep> DirectPrebuiltModularDeps;
325 llvm::SetVector<const Module *> DirectModularDeps;
329 llvm::StringSet<> VisibleModules;
332 std::unique_ptr<DependencyOutputOptions> Opts;
339 std::optional<P1689ModuleInfo> ProvidedStdCXXModule;
340 std::vector<P1689ModuleInfo> RequiredStdCXXModules;
343 bool isPrebuiltModule(
const Module *M);
346 void addVisibleModules();
349 void addFileDep(StringRef
Path);
360 llvm::DenseSet<const FileEntry *>
391 const StringRef Input);
407 return hash_combine(
ID.ModuleName,
ID.ContextHash);
410template <>
struct DenseMapInfo<
clang::tooling::dependencies::ModuleID> {
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
llvm::MachO::FileType FileType
Defines the clang::Module class, which describes a module in the source code.
Defines the PPCallbacks interface.
Defines the SourceManager interface.
Reads an AST files chain containing the contents of a translation unit.
Represents a character-granular source range.
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
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.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
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...
The JSON file list parser is used to communicate input to InstallAPI.
@ Other
Other implicit parameter.
Diagnostic wrappers for TextAPI types for error reporting.
hash_code hash_value(const clang::tooling::dependencies::ModuleID &ID)