[all-commits] [llvm/llvm-project] ec809e: PR47372: Fix Lambda invoker calling conventions

Erich Keane via All-commits all-commits at lists.llvm.org
Fri Oct 30 06:40:30 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ec809e4cfe0be08b1bab7ba7e6ff905b9430571a
      https://github.com/llvm/llvm-project/commit/ec809e4cfe0be08b1bab7ba7e6ff905b9430571a
  Author: Erich Keane <erich.keane at intel.com>
  Date:   2020-10-30 (Fri, 30 Oct 2020)

  Changed paths:
    M clang/include/clang/AST/DeclCXX.h
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/DeclCXX.cpp
    M clang/lib/AST/MicrosoftMangle.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaLambda.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/lib/Sema/SemaTemplateDeduction.cpp
    A clang/test/CodeGenCXX/lambda-conversion-op-cc.cpp
    A clang/test/SemaCXX/lambda-conversion-op-cc.cpp

  Log Message:
  -----------
  PR47372: Fix Lambda invoker calling conventions

As mentioned in the defect, the lambda static invoker does not follow
the calling convention of the lambda itself, which seems wrong. This
patch ensures that the calling convention of operator() is passed onto
the invoker and conversion-operator type.

This is accomplished by extracting the calling-convention determination
code out into a separate function in order to better reflect the 'thiscall'
work, as well as somewhat better support the future implementation of
https://devblogs.microsoft.com/oldnewthing/20150220-00/?p=44623

For any target (basically just win32) that has a different free and
static function calling convention, this generates BOTH alternatives.
This required some work to get the Windows mangler to work correctly for
this, as well as some tie-breaking for the unary operators.

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




More information about the All-commits mailing list