| 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 |
|
| 11 |
using namespace clang; |
| 12 |
using namespace dependencies; |
| 13 |
|
| 14 |
TranslationUnitDeps 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(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 |
|
| 38 |
CallbackActionController::~CallbackActionController() {} |