]> granicus.if.org Git - clang/commit
[AST] Re-add TypeLocs and NestedNameSpecifierLocs to the ParentMap.
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 23 Oct 2015 09:04:55 +0000 (09:04 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 23 Oct 2015 09:04:55 +0000 (09:04 +0000)
commit4c0bc1aa1bc4e732f76d2961368755ce6a925e8c
tree763039cd23c8a41ef6ac60b7840b5c8c945b5091
parent0a6b992d564a164e9f86f8965fbfe30c721563b8
[AST] Re-add TypeLocs and NestedNameSpecifierLocs to the ParentMap.

This relands r250831 after some fixes to shrink the ParentMap overall
with one addtional tweak: nodes with pointer identity (e.g. Decl* and
friends) can be store more efficiently so I put them in a separate map.
All other nodes (so far only TypeLoc and NNSLoc) go in a different map
keyed on DynTypedNode. This further uglifies the code but significantly
reduces memory overhead.

Overall this change still make ParentMap significantly larger but it's
nowhere as bad as before. I see about 25 MB over baseline (pre-r251008)
on X86ISelLowering.cpp. If this becomes an issue we could consider
splitting the maps further as DynTypedNode is still larger (32 bytes)
than a single TypeLoc (16 bytes) but I didn't want to introduce even
more complexity now.

Differential Revision: http://reviews.llvm.org/D14011

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251101 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/ASTContext.h
include/clang/AST/ASTTypeTraits.h
include/clang/ASTMatchers/ASTMatchers.h
include/clang/ASTMatchers/ASTMatchersInternal.h
lib/AST/ASTContext.cpp
lib/ASTMatchers/ASTMatchFinder.cpp
unittests/AST/ASTContextParentMapTest.cpp
unittests/ASTMatchers/Dynamic/ParserTest.cpp
unittests/ASTMatchers/Dynamic/RegistryTest.cpp