[all-commits] [llvm/llvm-project] f0c690: [OpenCL] Stop opencl-c-base.h leaking extension en...

Sven van Haastregt via All-commits all-commits at lists.llvm.org
Tue Nov 17 04:08:31 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f0c690018ad1fb4746da3aca26a443c0f96530fa
      https://github.com/llvm/llvm-project/commit/f0c690018ad1fb4746da3aca26a443c0f96530fa
  Author: Sven van Haastregt <sven.vanhaastregt at arm.com>
  Date:   2020-11-17 (Tue, 17 Nov 2020)

  Changed paths:
    M clang/lib/Headers/opencl-c-base.h
    M clang/lib/Headers/opencl-c.h
    M clang/test/SemaOpenCL/half.cl

  Log Message:
  -----------
  [OpenCL] Stop opencl-c-base.h leaking extension enabling

opencl-c.h disables all extensions at its end, but opencl-c-base.h
does not, and that causes any inclusion of only opencl-c-base.h to
leave some extensions (such as cl_khr_fp16) enabled.  This affects the
-fdeclare-opencl-builtins option for example.

This violates the OpenCL Extension Specification which specifies that
"The initial state of the compiler is as if the directive #pragma
OPENCL EXTENSION all : disable was issued".

Fix by disabling all extensions at the end of opencl-c-base.h and
enable extensions inside opencl.h which relied on opencl-c-base.h
enabling the cl_khr_fp16/64 extensions.

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




More information about the All-commits mailing list