[PATCH] D72857: [SYCL] Driver option to enable SYCL mode and select SYCL version

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 7 08:18:18 PST 2020


ABataev added inline comments.


================
Comment at: clang/lib/Frontend/CompilerInvocation.cpp:2547
 
+  Opts.SYCL = Args.hasFlag(options::OPT_fsycl, options::OPT_fno_sycl, false);
+  Opts.SYCLIsDevice = Args.hasArg(options::OPT_fsycl_is_device);
----------------
`-fno-sycl` should not be passed to frontend. Just use `hasFlag(OPT_fsycl)`.


================
Comment at: clang/lib/Frontend/CompilerInvocation.cpp:2548
+  Opts.SYCL = Args.hasFlag(options::OPT_fsycl, options::OPT_fno_sycl, false);
+  Opts.SYCLIsDevice = Args.hasArg(options::OPT_fsycl_is_device);
+  if (Opts.SYCL || Opts.SYCLIsDevice) {
----------------
This option also must be controlled by `-fsycl`:
```
Opts.SYCLIsDevice =  Opts.SYCL && Args.hasArg(options::OPT_fsycl_is_device);

```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72857





More information about the cfe-commits mailing list