]> granicus.if.org Git - clang/commit
[AST] Various micro-optimizations in CXXInheritance
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 20 Jul 2018 20:13:08 +0000 (20:13 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 20 Jul 2018 20:13:08 +0000 (20:13 +0000)
commitd642af48b03c96e5b32b80cc56e66c9bbd41fe44
tree951e2e800927a4475ab9f3ac4b1276db61ed0a65
parent769fd39841d862d24f81ac3e968a6d007626ccda
[AST] Various micro-optimizations in CXXInheritance

1. Pack std::pair<bool, unsigned> in CXXBasePaths::ClassSubobjects.
2. Use a SmallPtrSet instead of a SmallDenseSet for CXXBasePaths::VisitedDependentRecords.
3. Reorder some members of CXXBasePaths to save 8 bytes.
4. Use a SmallSetVector instead of a SetVector in CXXBasePaths::ComputeDeclsFound to avoid some allocations.

This speeds up an -fsyntax-only on all of Boost by approx 0.15%,
mainly by speeding up CXXBasePaths::lookupInBases by
approx 10%. No functional changes.

Patch by Bruno Ricci!

Differential Revision: https://reviews.llvm.org/D49302

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337607 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/CXXInheritance.h
lib/AST/CXXInheritance.cpp