[PATCH] D151051: [clang-tidy] Optimize misc-confusable-identifiers

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 21 14:07:51 PDT 2023


PiotrZSL created this revision.
PiotrZSL added reviewers: njames93, carlosgalvezp.
Herald added a subscriber: xazax.hun.
Herald added a project: All.
PiotrZSL requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Main performance issue in this check were caused by many
calls to getPrimaryContext and constant walk up to declaration
contexts using getParent. Also there were issue with forallBases
that is slow.

Profiled with perf and tested on open-source project Cataclysm-DDA.
Before changes check took 27320 seconds, after changes 3682 seconds.
That's 86.5% reduction. More optimizations are still possible in this
check.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151051

Files:
  clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp
  clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151051.524128.patch
Type: text/x-patch
Size: 7692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230521/26766f05/attachment.bin>


More information about the cfe-commits mailing list