[PATCH] D74048: [SYCL][Driver] Add clang driver option to enable SYCL compilation mode
Alexey Bataev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 5 06:30:36 PST 2020
ABataev added inline comments.
================
Comment at: clang/include/clang/Driver/Options.td:3411-3413
+// C++ SYCL options
+def fsycl : Flag<["-"], "fsycl">, Group<sycl_Group>,
+ HelpText<"Enable SYCL kernels compilation for device">;
----------------
Usually, we add a pair of such flags, `-fsycl` and `fno-sycl` to have the explicit way to disable some functionality.
================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4014-4016
+ if (IsSYCL) {
+ CmdArgs.push_back("-fsycl-is-device");
+ }
----------------
No need for braces here
================
Comment at: clang/test/Driver/sycl.c:5
+
+// DEFAULT: "-fsycl-is-device"
----------------
I would add a check that this flag is found on clang invocation with `-cc1` option (i.e. it is passed to the frontend)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74048/new/
https://reviews.llvm.org/D74048
More information about the cfe-commits
mailing list