[all-commits] [llvm/llvm-project] 269ef3: [clang-tidy] Use compiled regex for AllowedRegexp ...

smhc via All-commits all-commits at lists.llvm.org
Mon Nov 23 12:47:57 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 269ef315d1beaff534a038b60389226b0f0f5d4f
      https://github.com/llvm/llvm-project/commit/269ef315d1beaff534a038b60389226b0f0f5d4f
  Author: smhc <shanehird at gmail.com>
  Date:   2020-11-23 (Mon, 23 Nov 2020)

  Changed paths:
    M clang-tools-extra/clang-tidy/cppcoreguidelines/MacroUsageCheck.cpp

  Log Message:
  -----------
  [clang-tidy] Use compiled regex for AllowedRegexp in macro usage check

Current check compiles the regex on every attempt at matching. The check also populates and enables a regex value by default so the default behaviour results in regex re-compilation for every macro - if the check is enabled. If people used this check there's a reasonable chance they would have relatively complex regexes in use.

This is a quick and simple fix to store and use the compiled regex.

Reviewed By: njames93

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




More information about the All-commits mailing list