clang 22.0.0git
DependencyScanningUtils.cpp
Go to the documentation of this file.
1//===- DependencyScanningUtils.cpp - Common Scanning Utilities ------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
10
11using namespace clang;
12using namespace dependencies;
13
16
17 TU.ID.ContextHash = std::move(ContextHash);
18 TU.ID.ModuleName = std::move(ModuleName);
19 TU.NamedModuleDeps = std::move(NamedModuleDeps);
20 TU.FileDeps = std::move(Dependencies);
21 TU.PrebuiltModuleDeps = std::move(PrebuiltModuleDeps);
22 TU.VisibleModules = std::move(VisibleModules);
23 TU.Commands = std::move(Commands);
24
25 for (auto &&M : ClangModuleDeps) {
26 auto &MD = M.second;
27 // TODO: Avoid handleModuleDependency even being called for modules
28 // we've already seen.
29 if (AlreadySeen.count(M.first))
30 continue;
31 TU.ModuleGraph.push_back(std::move(MD));
32 }
33 TU.ClangModuleDeps = std::move(DirectModuleDeps);
34
35 return TU;
36}
37
The JSON file list parser is used to communicate input to InstallAPI.
std::string ModuleName
The name of the module.
std::string ContextHash
The context hash of a module represents the compiler options that affect the resulting command-line i...
The full dependencies and module graph for a specific input.
clang::dependencies::ModuleID ID
The identifier of the C++20 module this translation unit exports.
std::vector< std::string > VisibleModules
A list of module names that are visible to this translation unit.
std::vector< std::string > FileDeps
A collection of absolute paths to files that this translation unit directly depends on,...
std::vector< clang::dependencies::ModuleID > ClangModuleDeps
A list of modules this translation unit directly depends on, not including transitive dependencies.
std::vector< std::string > NamedModuleDeps
A list of the C++20 named modules this translation unit depends on.
std::vector< clang::dependencies::PrebuiltModuleDep > PrebuiltModuleDeps
A collection of prebuilt modules this translation unit directly depends on, not including transitive ...
std::vector< clang::dependencies::Command > Commands
The sequence of commands required to build the translation unit.
ModuleDepsGraph ModuleGraph
The graph of direct and transitive modular dependencies.