[all-commits] [llvm/llvm-project] 48ab96: [ASTMatchers][NFC] Use move semantics when passing...

Nathan James via All-commits all-commits at lists.llvm.org
Wed Mar 17 15:03:32 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 48ab9674b21be2c6206ccc04602d4a3e4c812953
      https://github.com/llvm/llvm-project/commit/48ab9674b21be2c6206ccc04602d4a3e4c812953
  Author: Nathan James <n.james93 at hotmail.co.uk>
  Date:   2021-03-17 (Wed, 17 Mar 2021)

  Changed paths:
    M clang/include/clang/ASTMatchers/ASTMatchersInternal.h
    M clang/include/clang/ASTMatchers/ASTMatchersMacros.h

  Log Message:
  -----------
  [ASTMatchers][NFC] Use move semantics when passing matchers around.

Changing matchers to use non-const members and adding r-value overloads of matcher conversions enables move optimisations.
I don't have performance figures but I can say this knocked 120k from the clang-tidy binary(86k was from the .text section) on a Release with assertions build(x86_64-unknown-linux-gnu).

Reviewed By: aaron.ballman

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




More information about the All-commits mailing list