summaryrefslogtreecommitdiffstats
path: root/clang/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
commit64af53c364bcc20d18210432dbaa6d94186858ff (patch)
tree2c03835cca08077dd592fc50b0849a5042be05ca /clang/lib/Serialization/ASTWriter.cpp
parentf740db31e20e18c02ef29e02f1a61900f2be8403 (diff)
downloadbcm5719-llvm-64af53c364bcc20d18210432dbaa6d94186858ff.tar.gz
bcm5719-llvm-64af53c364bcc20d18210432dbaa6d94186858ff.zip
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. llvm-svn: 147617
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 1317525c27d..52578599ea9 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/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?");
OpenPOWER on IntegriCloud