mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Take advantage of the binary swiftdeps serialization utliities built during #32131. Add a new optional information block to swiftdeps files. For now, don't actually serialize swiftdeps information. Frontends will use this information to determine whether to write incremental dependencies across modules into their swiftdeps files. We will then teach the driver to deserialize the data from this section and integrate it into its incremental decision making.
35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
//===--- SerializeIncremental.cpp - Write incremental swiftdeps -----------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2020 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#define DEBUG_TYPE "serialize-incremental"
|
|
#include "Serialization.h"
|
|
#include "swift/AST/FineGrainedDependencyFormat.h"
|
|
|
|
#include <type_traits>
|
|
|
|
using namespace swift;
|
|
using namespace swift::serialization;
|
|
using namespace llvm::support;
|
|
using llvm::BCBlockRAII;
|
|
|
|
void Serializer::writeIncrementalInfo(
|
|
const fine_grained_dependencies::SourceFileDepGraph *DepGraph) {
|
|
if (!DepGraph)
|
|
return;
|
|
|
|
{
|
|
BCBlockRAII restoreBlock(Out, INCREMENTAL_INFORMATION_BLOCK_ID, 5);
|
|
swift::fine_grained_dependencies::writeFineGrainedDependencyGraph(
|
|
Out, *DepGraph);
|
|
}
|
|
}
|