[all-commits] [llvm/llvm-project] e6522a: [OpenCL] Allow addr space qualifiers on lambda cal...

Anastasia Stulova via All-commits all-commits at lists.llvm.org
Wed Dec 4 04:25:48 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e6522a96f56ce0257ab8cc6fca77bf9ea4462fa6
      https://github.com/llvm/llvm-project/commit/e6522a96f56ce0257ab8cc6fca77bf9ea4462fa6
  Author: Anastasia Stulova <anastasia.stulova at arm.com>
  Date:   2019-12-04 (Wed, 04 Dec 2019)

  Changed paths:
    M clang/lib/Parse/ParseExprCXX.cpp
    M clang/test/SemaOpenCLCXX/address-space-lambda.cl

  Log Message:
  -----------
  [OpenCL] Allow addr space qualifiers on lambda call expressions

The addr space qualifier can be added optionally for lambdas after
the attributes. They will alter the default addr space of lambda
call operator that is in generic address space by default for OpenCL.

Syntax:

[ captures ] ( params ) specifiers exception attr opencl_addrspace
                    -> ret { body }

Example:

[&] (int i) mutable __global { ... };

On the call into lambda a compatibility check will be performed to
determine whether address space of lambda object and its call operator
are compatible. This will follow regular addr space conversion rules
and there will be no difference to how addr spaces work in method
qualifiers.

Tags: #clang

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




More information about the All-commits mailing list