mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Serialization] Reduce file size by splitting dep dirnames from basenames
Dependency tracking for cached compiled modules (compiled from swiftinterfaces) can lead to a high percentage of the module being SDK-relative paths when -track-system-dependencies is on. Cut down on this by storing directory names in a separate record that gets referenced from each file dependency. (Since a lot of per-file dependencies are header files in a common directory, this is a win.) We can do something more clever in the future, but this is a reasonable start for, say, the overlays. rdar://problem/50449802
This commit is contained in:
@@ -52,7 +52,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
|
||||
/// describe what change you made. The content of this comment isn't important;
|
||||
/// it just ensures a conflict if two people change the module format.
|
||||
/// Don't worry about adhering to the 80-column limit for this line.
|
||||
const uint16_t SWIFTMODULE_VERSION_MINOR = 488; // assign_by_delegate
|
||||
const uint16_t SWIFTMODULE_VERSION_MINOR = 489; // dependency directories
|
||||
|
||||
using DeclIDField = BCFixed<31>;
|
||||
|
||||
@@ -644,6 +644,7 @@ namespace input_block {
|
||||
MODULE_FLAGS, // [unused]
|
||||
SEARCH_PATH,
|
||||
FILE_DEPENDENCY,
|
||||
DEPENDENCY_DIRECTORY,
|
||||
PARSEABLE_INTERFACE_PATH
|
||||
};
|
||||
|
||||
@@ -689,9 +690,15 @@ namespace input_block {
|
||||
FileModTimeOrContentHashField, // mtime or content hash (for validation)
|
||||
BCFixed<1>, // are we reading mtime (0) or hash (1)?
|
||||
BCFixed<1>, // SDK-relative?
|
||||
BCVBR<8>, // subpath-relative index (0=none)
|
||||
BCBlob // path
|
||||
>;
|
||||
|
||||
using DependencyDirectoryLayout = BCRecordLayout<
|
||||
DEPENDENCY_DIRECTORY,
|
||||
BCBlob
|
||||
>;
|
||||
|
||||
using ParseableInterfaceLayout = BCRecordLayout<
|
||||
PARSEABLE_INTERFACE_PATH,
|
||||
BCBlob // file path
|
||||
|
||||
Reference in New Issue
Block a user