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

Anastasia Stulova via All-commits all-commits at lists.llvm.org
Wed Feb 12 04:48:42 PST 2020


  Branch: refs/heads/release/10.x
  Home:   https://github.com/llvm/llvm-project
  Commit: b33830aea54536f0f03334b2015b03af336ec90c
      https://github.com/llvm/llvm-project/commit/b33830aea54536f0f03334b2015b03af336ec90c
  Author: Anastasia Stulova <anastasia.stulova at arm.com>
  Date:   2020-02-12 (Wed, 12 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

(cherry picked from commit 6064f426a18304e16b51cc79e74c9c2d55ef5a9c)




More information about the All-commits mailing list