]> granicus.if.org Git - clang/commitdiff
shrink SOURCE_LOCATION_OFFSETS to use 4-byte entries instead of 8-byte
authorChris Lattner <sabre@nondot.org>
Mon, 27 Apr 2009 19:01:47 +0000 (19:01 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 27 Apr 2009 19:01:47 +0000 (19:01 +0000)
entries, shaving 100K off the PCH file for cocoa.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70228 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Frontend/PCHReader.h
lib/Frontend/PCHReader.cpp
lib/Frontend/PCHWriter.cpp

index a955b80695b31f3d1a9b819f71dd57b7807f8ca8..52f58f851143299b3c6808ce78e2492c930ed854 100644 (file)
@@ -106,7 +106,7 @@ private:
 
   /// \brief Offset type for all of the source location entries in the
   /// PCH file.
-  const uint64_t *SLocOffsets;
+  const uint32_t *SLocOffsets;
 
   /// \brief The number of source location entries in the PCH file.
   unsigned TotalNumSLocEntries;
index f87252a899235378ebef3f1d3915e1b7e19f196e..1b26b72c5ec710c18fc2885ae8c178125d21ef7f 100644 (file)
@@ -1017,7 +1017,7 @@ PCHReader::ReadPCHBlock() {
       break;
 
     case pch::SOURCE_LOCATION_OFFSETS:
-      SLocOffsets = (const uint64_t *)BlobStart;
+      SLocOffsets = (const uint32_t *)BlobStart;
       TotalNumSLocEntries = Record[0];
       PP.getSourceManager().PreallocateSLocEntries(this, 
                                                    TotalNumSLocEntries, 
index f0dd43ae8a1a4811245b5ed73787c5a2051f3645..d8603dfb6999cde1cb3c504262eb75a382704cd0 100644 (file)
@@ -738,7 +738,7 @@ void PCHWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
 
   // Write out the source location entry table. We skip the first
   // entry, which is always the same dummy entry.
-  std::vector<uint64_t> SLocEntryOffsets;
+  std::vector<uint32_t> SLocEntryOffsets;
   RecordData PreloadSLocs;
   SLocEntryOffsets.reserve(SourceMgr.sloc_entry_size() - 1);
   for (SourceManager::sloc_entry_iterator 
@@ -836,7 +836,7 @@ void PCHWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
   Record.push_back(SourceMgr.getNextOffset());
   Stream.EmitRecordWithBlob(SLocOffsetsAbbrev, Record,
                             (const char *)&SLocEntryOffsets.front(), 
-                            SLocEntryOffsets.size() * 8);
+                           SLocEntryOffsets.size()*sizeof(SLocEntryOffsets[0]));
 
   // Write the source location entry preloads array, telling the PCH
   // reader which source locations entries it should load eagerly.