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
9#include "clang/DependencyScanning/DependencyScanningUtils.h"
10
11using namespace clang;
12using namespace dependencies;
13
14TranslationUnitDeps FullDependencyConsumer::takeTranslationUnitDeps() {
15 TranslationUnitDeps TU;
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(V: M.first))
30 continue;
31 TU.ModuleGraph.push_back(x: std::move(MD));
32 }
33 TU.ClangModuleDeps = std::move(DirectModuleDeps);
34
35 return TU;
36}
37
38CallbackActionController::~CallbackActionController() {}
39