summaryrefslogtreecommitdiffstats
path: root/clang/Driver/CacheTokens.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-12-03 01:16:39 +0000
committerTed Kremenek <kremenek@apple.com>2008-12-03 01:16:39 +0000
commit73a4d28758acae423f05aa1eaa99665ee5a21c3c (patch)
tree8ff38949685f8ac17c6fb6b15c2c24c4b956ee04 /clang/Driver/CacheTokens.cpp
parent971c88f3b2e45331d2ecd660f8e0dbfc1e240d40 (diff)
downloadbcm5719-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.cpp5
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);
OpenPOWER on IntegriCloud