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

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 27 19:24:56 PDT 2020


yaxunl added a comment.

In D78979#2006847 <https://reviews.llvm.org/D78979#2006847>, @arsenm wrote:

> 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?


-nogpulib is fine since opencl compiler is in parallel with the device compiler of CUDA/HIP. The library it uses is the device library.



================
Comment at: clang/lib/Frontend/CompilerInvocation.cpp:2548
 
-  Opts.IncludeDefaultHeader = Args.hasArg(OPT_finclude_default_header);
+  Opts.IncludeDefaultHeader = !Args.hasArg(OPT_fno_include_default_header);
   Opts.DeclareOpenCLBuiltins = Args.hasArg(OPT_fdeclare_opencl_builtins);
----------------
should use hasFlag in case there are multiple occurrences of both options. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78979/new/

https://reviews.llvm.org/D78979





More information about the cfe-commits mailing list