PTH: Embed a persistentID side-table in the PTH file that is sorted in the
lexical order of the corresponding identifier strings. This will be used for a
forthcoming optimization. This slows down PTH generation time by 7%. We can
revert this change if the optimization proves to not be valuable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62248 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp
index 8d04736..86c6577 100644
--- a/lib/Lex/PTHLexer.cpp
+++ b/lib/Lex/PTHLexer.cpp
@@ -538,11 +538,12 @@
// Compute the address of the index table at the end of the PTH file.
// This table contains the offset of the file lookup table, the
// persistent ID -> identifer data table.
- const char* EndTable = BufEnd - sizeof(uint32_t)*3;
+ // FIXME: We should just embed this offset in the PTH file.
+ const char* EndTable = BufEnd - sizeof(uint32_t)*4;
// Construct the file lookup table. This will be used for mapping from
// FileEntry*'s to cached tokens.
- const char* FileTableOffset = EndTable + sizeof(uint32_t)*2;
+ const char* FileTableOffset = EndTable + sizeof(uint32_t)*3;
const char* FileTable = BufBeg + Read32(FileTableOffset);
if (!(FileTable > BufBeg && FileTable < BufEnd)) {