encode the type and decl offsets with 32-bits for entry instead
of 64 bits. This cuts 400KB off the PCH file for cocoa (7.1 ->
6.7MB):
Before:
Record Histogram:
Count # Bits % Abv Record Kind
1 14296 SOURCE_LOCATION_PRELOADS
1 1699598 100.00 SOURCE_LOCATION_OFFSETS
1 1870766 100.00 METHOD_POOL
1 212988 100.00 SELECTOR_OFFSETS
1 88 STATISTICS
1 106 SPECIAL_TYPES
1 18033788 100.00 IDENTIFIER_TABLE
1 1806428 100.00 IDENTIFIER_OFFSET
1 170 100.00 TARGET_TRIPLE
1 268 LANGUAGE_OPTIONS
1 5168252 100.00 DECL_OFFSET
1 952700 100.00 TYPE_OFFSET
After:
Record Histogram:
Count # Bits % Abv Record Kind
1 14296 SOURCE_LOCATION_PRELOADS
1 1699598 100.00 SOURCE_LOCATION_OFFSETS
1 1870766 100.00 METHOD_POOL
1 212988 100.00 SELECTOR_OFFSETS
1 88 STATISTICS
1 106 SPECIAL_TYPES
1 18033788 100.00 IDENTIFIER_TABLE
1 1806428 100.00 IDENTIFIER_OFFSET
1 170 100.00 TARGET_TRIPLE
1 268 LANGUAGE_OPTIONS
1 2584156 100.00 DECL_OFFSET
1 476380 100.00 TYPE_OFFSET
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70216 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp
index bb72f78..82eb5df 100644
--- a/lib/Frontend/PCHWriter.cpp
+++ b/lib/Frontend/PCHWriter.cpp
@@ -1565,7 +1565,7 @@
Record.push_back(TypeOffsets.size());
Stream.EmitRecordWithBlob(TypeOffsetAbbrev, Record,
(const char *)&TypeOffsets.front(),
- TypeOffsets.size() * sizeof(uint64_t));
+ TypeOffsets.size() * sizeof(TypeOffsets[0]));
// Write the declaration offsets array
Abbrev = new BitCodeAbbrev();
@@ -1578,7 +1578,7 @@
Record.push_back(DeclOffsets.size());
Stream.EmitRecordWithBlob(DeclOffsetAbbrev, Record,
(const char *)&DeclOffsets.front(),
- DeclOffsets.size() * sizeof(uint64_t));
+ DeclOffsets.size() * sizeof(DeclOffsets[0]));
// Write the record of special types.
Record.clear();