aboutsummaryrefslogtreecommitdiff
path: root/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
commit6183e4815a4019e97ad01bd880f12355599b75fd (patch)
tree589e27bf701ddb8451dcf14128bef726733a3477 /Driver/CacheTokens.cpp
parent15f081de2c8ac7deadf5d938b458b20732230cd9 (diff)
PTH:
Use an array instead of a DenseMap to cache persistent IDs -> IdentifierInfo*. This leads to a 4% speedup at -fsyntax-only using PTH. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60452 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/CacheTokens.cpp')
-rw-r--r--Driver/CacheTokens.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Driver/CacheTokens.cpp b/Driver/CacheTokens.cpp
index 536fefca4d..7904954fce 100644
--- a/Driver/CacheTokens.cpp
+++ b/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);