[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 08:21:53 PST 2020


ABataev added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4028-4030
+  Arg *SYCLArg = Args.getLastArg(options::OPT_fsycl, options::OPT_fno_sycl);
+  if (SYCLArg)
+    IsSYCL = SYCLArg->getOption().matches(options::OPT_fsycl);
----------------
I suggest to use `hasFlag` function, something like this:
```
if (Args.hasFlag(options::OPT_fsycl, options::OPT_fno_sycl, false))
  CmdArgs.push_back("-fsycl-is-device");
```


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