summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PTHLexer.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-01-15 01:26:25 +0000
committerTed Kremenek <kremenek@apple.com>2009-01-15 01:26:25 +0000
commitbef9fc224029c77e3cc26beb412a124c7605ddee (patch)
tree4ae9cf130d09acb9ba363092eb23b2b4a7ba17d0 /clang/lib/Lex/PTHLexer.cpp
parent960b5bc7c1f8ec1c35719bd6731c78415e72eb0f (diff)
downloadbcm5719-llvm-bef9fc224029c77e3cc26beb412a124c7605ddee.tar.gz
bcm5719-llvm-bef9fc224029c77e3cc26beb412a124c7605ddee.zip
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. llvm-svn: 62248
Diffstat (limited to 'clang/lib/Lex/PTHLexer.cpp')
-rw-r--r--clang/lib/Lex/PTHLexer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Lex/PTHLexer.cpp b/clang/lib/Lex/PTHLexer.cpp
index 8d04736ced8..86c65771fd6 100644
--- a/clang/lib/Lex/PTHLexer.cpp
+++ b/clang/lib/Lex/PTHLexer.cpp
@@ -538,11 +538,12 @@ PTHManager* PTHManager::Create(const std::string& file, Preprocessor& PP) {
// 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)) {
OpenPOWER on IntegriCloud