mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL Serialization: seperate sil_index_block from sil_block.
Use generic layout for Lists and Offsets in sil_index_block. This will help handling of VTable. Records for VTable are added. Swift SVN r9735
This commit is contained in:
@@ -1073,12 +1073,11 @@ void SILSerializer::writeFuncTable() {
|
||||
tableOffset = generator.Emit(blobStream);
|
||||
}
|
||||
|
||||
unsigned abbrCode = SILAbbrCodes[FuncListLayout::Code];
|
||||
FuncListLayout::emitRecord(Out, ScratchRecord, abbrCode, tableOffset,
|
||||
hashTableBlob);
|
||||
|
||||
abbrCode = SILAbbrCodes[FuncOffsetLayout::Code];
|
||||
FuncOffsetLayout::emitRecord(Out, ScratchRecord, abbrCode, Funcs);
|
||||
sil_index_block::ListLayout List(Out);
|
||||
sil_index_block::OffsetLayout Offset(Out);
|
||||
List.emit(ScratchRecord, sil_index_block::SIL_FUNC_NAMES, tableOffset,
|
||||
hashTableBlob);
|
||||
Offset.emit(ScratchRecord, sil_index_block::SIL_FUNC_OFFSETS, Funcs);
|
||||
}
|
||||
|
||||
void SILSerializer::writeAllSILFunctions(const SILModule *M) {
|
||||
@@ -1097,6 +1096,9 @@ void SILSerializer::writeAllSILFunctions(const SILModule *M) {
|
||||
registerSILAbbr<SILInstApplyLayout>();
|
||||
registerSILAbbr<SILInstNoOperandLayout>();
|
||||
|
||||
registerSILAbbr<VTableLayout>();
|
||||
registerSILAbbr<VTableEntryLayout>();
|
||||
|
||||
// Register the abbreviation codes so these layouts can exist in both
|
||||
// decl blocks and sil blocks.
|
||||
// We have to make sure BOUND_GENERIC_SUBSTITUTION does not overlap with
|
||||
@@ -1117,8 +1119,6 @@ void SILSerializer::writeAllSILFunctions(const SILModule *M) {
|
||||
}
|
||||
{
|
||||
BCBlockRAII restoreBlock(Out, SIL_INDEX_BLOCK_ID, 4);
|
||||
registerSILAbbr<FuncListLayout>();
|
||||
registerSILAbbr<FuncOffsetLayout>();
|
||||
writeFuncTable();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user