[all-commits] [llvm/llvm-project] 6064f4: [OpenCL] Restrict addr space conversions in nested...

Anastasia Stulova via All-commits all-commits at lists.llvm.org
Fri Feb 7 04:05:20 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6064f426a18304e16b51cc79e74c9c2d55ef5a9c
      https://github.com/llvm/llvm-project/commit/6064f426a18304e16b51cc79e74c9c2d55ef5a9c
  Author: Anastasia Stulova <anastasia.stulova at arm.com>
  Date:   2020-02-07 (Fri, 07 Feb 2020)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaCast.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl
    M clang/test/SemaOpenCL/address-spaces.cl
    A clang/test/SemaOpenCLCXX/address-space-castoperators.cl
    M clang/test/SemaOpenCLCXX/address-space-deduction.cl
    M clang/test/SemaOpenCLCXX/address-space-references.cl

  Log Message:
  -----------
  [OpenCL] Restrict addr space conversions in nested pointers

Address space conversion changes pointer representation.
This commit disallows such conversions when they are not
legal i.e. for the nested pointers even with compatible
address spaces. Because the address space conversion in
the nested levels can't be generated to modify the pointers
correctly. The behavior implemented is as follows:

- Any implicit conversions of nested pointers with different
  address spaces is rejected.
- Any conversion of address spaces in nested pointers in safe
  casts (e.g. const_cast or static_cast) is rejected.
- Conversion in low level C-style or reinterpret_cast is accepted
  but with a warning (this aligns with OpenCL C behavior).

Fixes PR39674

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




More information about the All-commits mailing list