diff options
| author | Ted Kremenek <kremenek@apple.com> | 2008-12-03 01:16:39 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2008-12-03 01:16:39 +0000 |
| commit | 73a4d28758acae423f05aa1eaa99665ee5a21c3c (patch) | |
| tree | 8ff38949685f8ac17c6fb6b15c2c24c4b956ee04 /clang/Driver/CacheTokens.cpp | |
| parent | 971c88f3b2e45331d2ecd660f8e0dbfc1e240d40 (diff) | |
| download | bcm5719-llvm-73a4d28758acae423f05aa1eaa99665ee5a21c3c.tar.gz bcm5719-llvm-73a4d28758acae423f05aa1eaa99665ee5a21c3c.zip | |
PTH:
Use an array instead of a DenseMap to cache persistent IDs -> IdentifierInfo*. This leads to a 4% speedup at -fsyntax-only using PTH.
llvm-svn: 60452
Diffstat (limited to 'clang/Driver/CacheTokens.cpp')
| -rw-r--r-- | clang/Driver/CacheTokens.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/Driver/CacheTokens.cpp b/clang/Driver/CacheTokens.cpp index 536fefca4db..7904954fce4 100644 --- a/clang/Driver/CacheTokens.cpp +++ b/clang/Driver/CacheTokens.cpp @@ -104,7 +104,7 @@ EmitIdentifierTable(llvm::raw_fd_ostream& Out, uint32_t max, } Offset DataOff = Out.tell(); - + for (InverseIDMap::iterator I=IIDMap.begin(), E=IIDMap.end(); I!=E; ++I) { // Record the location for this data. I->FileOffset = Out.tell(); @@ -118,6 +118,9 @@ EmitIdentifierTable(llvm::raw_fd_ostream& Out, uint32_t max, // Now emit the table mapping from persistent IDs to PTH file offsets. Offset IDOff = Out.tell(); + // Emit the number of identifiers. + Emit32(Out, max); + for (InverseIDMap::iterator I=IIDMap.begin(), E=IIDMap.end(); I!=E; ++I) Emit32(Out, I->FileOffset); |

