[all-commits] [llvm/llvm-project] 8fdedc: [clang-tidy] Optimize misc-confusable-identifiers

Piotr Zegar via All-commits all-commits at lists.llvm.org
Sat Jun 10 04:07:12 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8fdedcd1a242f6b54eec969e72e35ac0a68b7ea1
      https://github.com/llvm/llvm-project/commit/8fdedcd1a242f6b54eec969e72e35ac0a68b7ea1
  Author: Piotr Zegar <me at piotrzegar.pl>
  Date:   2023-06-10 (Sat, 10 Jun 2023)

  Changed paths:
    M clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp
    M clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.h

  Log Message:
  -----------
  [clang-tidy] Optimize misc-confusable-identifiers

This is final optimization for this check. Main
improvements comes from changing a logic order
in mayShadow function, to first validate result
of mayShadowImpl, then search primary context in
a vectors. Secondary improvement comes from excluding
all implicit code by using TK_IgnoreUnlessSpelledInSource.
All other changes are just cosmetic improvements.

Tested on Cataclysm-DDA open source project, result in
check execution time reduction from 3682 seconds to
100 seconds (~0.25s per TU). That's 97.2% reduction for
this change alone. Resulting in cumulative improvement for
this check around -99.6%, finally bringing this check
into a cheap category.

Reviewed By: serge-sans-paille

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




More information about the All-commits mailing list