[all-commits] [llvm/llvm-project] a7579b: [Clang] Improve compile times when forming a DeclR...

cor3ntin via All-commits all-commits at lists.llvm.org
Mon May 8 09:41:38 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a7579b25df78a9f53d62300020d4ae3c47666634
      https://github.com/llvm/llvm-project/commit/a7579b25df78a9f53d62300020d4ae3c47666634
  Author: Corentin Jabot <corentinjabot at gmail.com>
  Date:   2023-05-08 (Mon, 08 May 2023)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/Sema.cpp
    M clang/lib/Sema/SemaExpr.cpp

  Log Message:
  -----------
  [Clang] Improve compile times when forming a DeclRef outside of a capturing scope.

The logic of whether an entity needs to be captured has become
quite complex and the recent changes in https://reviews.llvm.org/D124351
ad a mesurable negative impact on compile times.

However, in the absence of capturing scopes (lambda, block, region)
we usually can avoid running most of that logic
(except that we do need to diagnostic when a nested function
refers to a local variable in the scope of the outer function.).

This patch track whether there is currently an active capturing
scope and exit `tryCaptureVariable` early when there isn't.

Reviewed By: aaron.ballman

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




More information about the All-commits mailing list