[PATCH] D49302: [AST] Various micro-optimizations in CXXInheritance

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 13 09:26:46 PDT 2018


bricci created this revision.
bricci added reviewers: arphaman, bkramer, rsmith.
bricci added a project: clang.
Herald added a subscriber: cfe-commits.

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.


Repository:
  rC Clang

https://reviews.llvm.org/D49302

Files:
  include/clang/AST/CXXInheritance.h
  lib/AST/CXXInheritance.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49302.155392.patch
Type: text/x-patch
Size: 5184 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180713/2a9800fb/attachment.bin>


More information about the cfe-commits mailing list