mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialize] Serialize uniqued generic signatures.
Rather than inlining generic signatures in a half dozen places throughout the serialization format, serialize (uniqued) generic signatures with their own GenericSignatureID. Update various layouts (generic function types, SIL function types, generic environments, extension cross-references) to use GenericSignatureID. Shaves ~187k off the size of Swift.swiftmodule.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "swift/Subsystems.h"
|
||||
#include "swift/AST/ASTContext.h"
|
||||
#include "swift/AST/ASTMangler.h"
|
||||
#include "swift/AST/GenericSignature.h"
|
||||
#include "swift/AST/ModuleLoader.h"
|
||||
#include "swift/AST/NameLookup.h"
|
||||
#include "swift/AST/USRGeneration.h"
|
||||
@@ -842,6 +843,10 @@ bool ModuleFile::readIndexBlock(llvm::BitstreamCursor &cursor) {
|
||||
assert(blobData.empty());
|
||||
LocalDeclContexts.assign(scratch.begin(), scratch.end());
|
||||
break;
|
||||
case index_block::GENERIC_SIGNATURE_OFFSETS:
|
||||
assert(blobData.empty());
|
||||
GenericSignatures.assign(scratch.begin(), scratch.end());
|
||||
break;
|
||||
case index_block::GENERIC_ENVIRONMENT_OFFSETS:
|
||||
assert(blobData.empty());
|
||||
GenericEnvironments.assign(scratch.begin(), scratch.end());
|
||||
|
||||
Reference in New Issue
Block a user