diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-12-23 18:41:34 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-12-23 18:41:34 +0000 |
commit | a754c40390d8fa019e1c4aabf16c5fd368041b1f (patch) | |
tree | 9761cb683271f5011af7b000babd8ed44c0ec7f8 /clang/lib/Lex/PTHLexer.cpp | |
parent | 04543e719e53c3ebd6533ef4cb4bdf60c27d658c (diff) | |
download | bcm5719-llvm-a754c40390d8fa019e1c4aabf16c5fd368041b1f.tar.gz bcm5719-llvm-a754c40390d8fa019e1c4aabf16c5fd368041b1f.zip |
PTH: Use 3 bytes instead of 4 bytes to encode the persistent ID for a token.
- This reduces the PTH size for Cocoa.h by 7%.
- The increases PTH -Eonly speed for Cocoa.h by 0.8%.
llvm-svn: 61377
Diffstat (limited to 'clang/lib/Lex/PTHLexer.cpp')
-rw-r--r-- | clang/lib/Lex/PTHLexer.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/clang/lib/Lex/PTHLexer.cpp b/clang/lib/Lex/PTHLexer.cpp index dc8f842cec2..b60b915d922 100644 --- a/clang/lib/Lex/PTHLexer.cpp +++ b/clang/lib/Lex/PTHLexer.cpp @@ -26,7 +26,7 @@ using namespace clang; -#define DISK_TOKEN_SIZE (2+4+4+2) +#define DISK_TOKEN_SIZE (1+1+3+4+2) //===----------------------------------------------------------------------===// // Utility methods for reading from the mmap'ed PTH file. @@ -69,16 +69,15 @@ LexNextToken: uint32_t perID = ((uint32_t) CurPtrShadow[2]) | (((uint32_t) CurPtrShadow[3]) << 8) - | (((uint32_t) CurPtrShadow[4]) << 16) - | (((uint32_t) CurPtrShadow[5]) << 24); + | (((uint32_t) CurPtrShadow[4]) << 16); - uint32_t FileOffset = ((uint32_t) CurPtrShadow[6]) - | (((uint32_t) CurPtrShadow[7]) << 8) - | (((uint32_t) CurPtrShadow[8]) << 16) - | (((uint32_t) CurPtrShadow[9]) << 24); + uint32_t FileOffset = ((uint32_t) CurPtrShadow[5]) + | (((uint32_t) CurPtrShadow[6]) << 8) + | (((uint32_t) CurPtrShadow[7]) << 16) + | (((uint32_t) CurPtrShadow[8]) << 24); - uint32_t Len = ((uint32_t) CurPtrShadow[10]) - | (((uint32_t) CurPtrShadow[11]) << 8); + uint32_t Len = ((uint32_t) CurPtrShadow[9]) + | (((uint32_t) CurPtrShadow[10]) << 8); CurPtr = (const char*) (CurPtrShadow + DISK_TOKEN_SIZE); |