mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[serialization] Rename SILGenericOuterParamDeclID to SILGenericOuterParams.
Also, add the record to the block info for the SIL block, so that it can be inspected by llvm-bcanalyzer. Swift SVN r14417
This commit is contained in:
@@ -326,11 +326,11 @@ maybeReadGenericDeclContext(ModuleFile *MF, llvm::BitstreamCursor &Cursor) {
|
||||
return MF->getAssociatedModule();
|
||||
|
||||
unsigned kind = Cursor.readRecord(next.ID, scratch);
|
||||
if (kind != SIL_GENERIC_OUTER_PARAM_DECL_ID)
|
||||
if (kind != SIL_GENERIC_OUTER_PARAMS)
|
||||
return MF->getAssociatedModule();
|
||||
|
||||
uint64_t declID;
|
||||
SILGenericOuterParamDeclIDLayout::readRecord(scratch, declID);
|
||||
SILGenericOuterParamsLayout::readRecord(scratch, declID);
|
||||
return MF->getDeclContext((DeclID)declID);
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace sil_block {
|
||||
SIL_WITNESS_BASE_ENTRY = decls_block::BOUND_GENERIC_SUBSTITUTION + 1,
|
||||
SIL_WITNESS_ASSOC_PROTOCOL,
|
||||
SIL_WITNESS_ASSOC_ENTRY,
|
||||
SIL_GENERIC_OUTER_PARAM_DECL_ID,
|
||||
SIL_GENERIC_OUTER_PARAMS,
|
||||
|
||||
// We also share these layouts from the decls block. Their enumerators must
|
||||
// not overlap with ours.
|
||||
@@ -298,8 +298,8 @@ namespace sil_block {
|
||||
SILValueResultField
|
||||
>;
|
||||
|
||||
using SILGenericOuterParamDeclIDLayout = BCRecordLayout<
|
||||
SIL_GENERIC_OUTER_PARAM_DECL_ID,
|
||||
using SILGenericOuterParamsLayout = BCRecordLayout<
|
||||
SIL_GENERIC_OUTER_PARAMS,
|
||||
DeclIDField // The decl id of the outer param if any.
|
||||
>;
|
||||
}
|
||||
|
||||
@@ -283,6 +283,7 @@ void Serializer::writeBlockInfoBlock() {
|
||||
BLOCK_RECORD(sil_block, SIL_WITNESS_BASE_ENTRY);
|
||||
BLOCK_RECORD(sil_block, SIL_WITNESS_ASSOC_PROTOCOL);
|
||||
BLOCK_RECORD(sil_block, SIL_WITNESS_ASSOC_ENTRY);
|
||||
BLOCK_RECORD(sil_block, SIL_GENERIC_OUTER_PARAMS);
|
||||
|
||||
// These layouts can exist in both decl blocks and sil blocks.
|
||||
#define BLOCK_RECORD_WITH_NAMESPACE(K, X) emitRecordID(Out, X, #X, nameBuffer)
|
||||
|
||||
@@ -209,11 +209,9 @@ void SILSerializer::writeSILFunction(const SILFunction &F, bool DeclOnly) {
|
||||
// parent.
|
||||
if (GenericParamList *outerParams = gp->getOuterParameters()) {
|
||||
DeclID D = S.addDeclRef(S.getGenericContext(outerParams));
|
||||
using SILGenericOuterParamDeclIDLayout =
|
||||
SILGenericOuterParamDeclIDLayout;
|
||||
unsigned abbrCode = SILAbbrCodes[SILGenericOuterParamDeclIDLayout::Code];
|
||||
SILGenericOuterParamDeclIDLayout::emitRecord(Out, ScratchRecord, abbrCode,
|
||||
D);
|
||||
unsigned abbrCode = SILAbbrCodes[SILGenericOuterParamsLayout::Code];
|
||||
SILGenericOuterParamsLayout::emitRecord(Out, ScratchRecord, abbrCode,
|
||||
D);
|
||||
}
|
||||
|
||||
S.writeGenericParams(gp, SILAbbrCodes);
|
||||
@@ -1385,7 +1383,7 @@ void SILSerializer::writeModule(const SILModule *SILMod) {
|
||||
registerSILAbbr<WitnessBaseEntryLayout>();
|
||||
registerSILAbbr<WitnessAssocProtocolLayout>();
|
||||
registerSILAbbr<WitnessAssocEntryLayout>();
|
||||
registerSILAbbr<SILGenericOuterParamDeclIDLayout>();
|
||||
registerSILAbbr<SILGenericOuterParamsLayout>();
|
||||
|
||||
registerSILAbbr<SILInstCastLayout>();
|
||||
|
||||
|
||||
@@ -1,2 +1,5 @@
|
||||
// Make sure that we can deserialize the stdlib.
|
||||
// RUN: %sil-opt -verify %libdir/swift/macosx/Swift.swiftmodule -module-name=Swift > /dev/null
|
||||
// RUN: llvm-bcanalyzer %libdir/swift/macosx/Swift.swiftmodule | FileCheck %s
|
||||
|
||||
// CHECK-NOT: Unknown
|
||||
|
||||
Reference in New Issue
Block a user