[PATCH] D78979: OpenCL: Include builtin header by default

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 27 18:52:59 PDT 2020


arsenm created this revision.
arsenm added reviewers: Anastasia, yaxunl.
Herald added subscribers: kerbowa, nhaehnle, wdng, jvesely.
arsenm added a comment.

I'm also wondering if using -nogpulib for the corresponding linker purpose was correct, since in the OpenCL case it's not really an offload target. Maybe this should switch to -nostdlib?


Nonsensically, the default header is not included by default. Users
are using the cc1 flag to compile OpenCL programs, which should not be
required. Switch the default, and allow -nostdinc to disable the
include.

      

I'm somewhat confused by the way this is supposed to work, or why a
separate option exists for OpenCL. The other language flags seem to be
implemented in the driver, not cc1 like OpenCL. I'm not sure this is
the right set of flag naming decisions, or if we really need the
fno-include-default-header cc1 flag.


https://reviews.llvm.org/D78979

Files:
  clang/include/clang/Driver/CC1Options.td
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/CodeGenOpenCL/amdgpu-enqueue-kernel.cl
  clang/test/CodeGenOpenCL/atomic-ops-libcall.cl
  clang/test/CodeGenOpenCL/atomic-ops.cl
  clang/test/CodeGenOpenCL/bool_cast.cl
  clang/test/CodeGenOpenCL/cl20-device-side-enqueue.cl
  clang/test/CodeGenOpenCL/enqueue-kernel-non-entry-block.cl
  clang/test/CodeGenOpenCL/ext-int-shift.cl
  clang/test/CodeGenOpenCL/fpmath.cl
  clang/test/CodeGenOpenCL/half.cl
  clang/test/CodeGenOpenCL/null_queue.cl
  clang/test/CodeGenOpenCL/overload.cl
  clang/test/Driver/nostdinc.cl
  clang/test/Parser/opencl-atomics-cl20.cl
  clang/test/SemaOpenCL/atomic-ops.cl
  clang/test/SemaOpenCL/cl20-device-side-enqueue.cl
  clang/test/SemaOpenCL/extensions.cl
  clang/test/SemaOpenCL/half.cl
  clang/test/SemaOpenCL/null_queue.cl
  clang/test/SemaOpenCL/sampler_t.cl
  clang/unittests/AST/MatchVerifier.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78979.260523.patch
Type: text/x-patch
Size: 23062 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200428/7828fcfe/attachment-0001.bin>


More information about the cfe-commits mailing list