summaryrefslogtreecommitdiffstats
path: root/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-05 22:27:05 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-05 22:27:05 +0000
commitb6b60c1521a2e65f60e93c5fd56c103cf027df63 (patch)
tree3f7b845da88ecc38adcc50abba137f9ca97b83e8 /lib/Serialization/ASTWriter.cpp
parent1e68ecc4fcce12f683c4fd38acfd1a004001b04f (diff)
When we deserialize a declaration from a module file, allocate extra
storage for the global declaration ID. Declarations that are parsed (rather than deserialized) are unaffected, so the number of declarations that pay this cost tends to be relatively small (since relatively few declarations are ever deserialized). This replaces a largish DenseMap within the AST reader. It's not strictly a win in terms of memory use---not every declaration was added to that DenseMap in the first place---but it's cleaner to have this information available for every deserialized declaration, so that future clients can rely on it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147617 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r--lib/Serialization/ASTWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp
index 1317525c27..52578599ea 100644
--- a/lib/Serialization/ASTWriter.cpp
+++ b/lib/Serialization/ASTWriter.cpp
@@ -2914,7 +2914,7 @@ void ASTWriter::WriteMergedDecls() {
for (ASTReader::MergedDeclsMap::iterator I = Chain->MergedDecls.begin(),
IEnd = Chain->MergedDecls.end();
I != IEnd; ++I) {
- DeclID CanonID = I->first->isFromASTFile()? Chain->DeclToID[I->first]
+ DeclID CanonID = I->first->isFromASTFile()? I->first->getGlobalID()
: getDeclID(I->first);
assert(CanonID && "Merged declaration not known?");