Correct the Serialization of Embedded Swift Dependencies

llvm-bcanalyzer does *not* like it when there are multiple block info metadata blocks in the same bitstream file. This patch will skip the emission of that and just jump straight to the metadata block when we're not reading a "standalone" incremental dependency file. While I'm here, also add the right block abbreviation info so we can get a decent dump from llvm-bcanalyzer
This commit is contained in:
Robert Widmann
2020-10-05 18:40:43 -07:00
parent 161899d490
commit 82e9935885
7 changed files with 51 additions and 59 deletions

View File

@@ -861,6 +861,13 @@ void Serializer::writeBlockInfoBlock() {
BLOCK_RECORD(sil_index_block, SIL_DIFFERENTIABILITY_WITNESS_NAMES);
BLOCK_RECORD(sil_index_block, SIL_DIFFERENTIABILITY_WITNESS_OFFSETS);
BLOCK(INCREMENTAL_INFORMATION_BLOCK);
BLOCK_RECORD(fine_grained_dependencies::record_block, METADATA);
BLOCK_RECORD(fine_grained_dependencies::record_block, SOURCE_FILE_DEP_GRAPH_NODE);
BLOCK_RECORD(fine_grained_dependencies::record_block, FINGERPRINT_NODE);
BLOCK_RECORD(fine_grained_dependencies::record_block, DEPENDS_ON_DEFINITION_NODE);
BLOCK_RECORD(fine_grained_dependencies::record_block, IDENTIFIER_NODE);
#undef BLOCK
#undef BLOCK_RECORD
}
@@ -5231,8 +5238,9 @@ void Serializer::writeToStream(
S.writeInputBlock(options);
S.writeSIL(SILMod, options.SerializeAllSIL);
S.writeAST(DC);
if (options.ExperimentalCrossModuleIncrementalInfo) {
S.writeIncrementalInfo(DepGraph);
if (options.ExperimentalCrossModuleIncrementalInfo && DepGraph) {
fine_grained_dependencies::writeFineGrainedDependencyGraph(
S.Out, *DepGraph, /*standalone*/ false);
}
}