[all-commits] [llvm/llvm-project] 4a1ccf: When merging lambdas, keep track of the capture li...

Richard Smith via All-commits all-commits at lists.llvm.org
Thu Dec 8 11:38:25 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4a1ccfe8a3cfd4569bc962a38b6117a9a2b8ad21
      https://github.com/llvm/llvm-project/commit/4a1ccfe8a3cfd4569bc962a38b6117a9a2b8ad21
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2022-12-08 (Thu, 08 Dec 2022)

  Changed paths:
    M clang/include/clang/AST/DeclCXX.h
    M clang/lib/AST/DeclCXX.cpp
    M clang/lib/AST/ExprCXX.cpp
    M clang/lib/Serialization/ASTReaderDecl.cpp
    M clang/lib/Serialization/ASTWriter.cpp
    A clang/test/Modules/lambda-merge.cpp

  Log Message:
  -----------
  When merging lambdas, keep track of the capture lists from each version.

Different versions of a lambda will in general refer to different
enclosing variable declarations, because we do not merge most
block-scope declarations, such as local variables. Keep track of all the
declarations that correspond to a lambda's capture fields so that we can
rewrite the name of any of those variables to the lambda capture,
regardless of which copy of the body of `operator()` we look at.




More information about the All-commits mailing list