aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 9cb859f..809492a 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -3648,6 +3648,16 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
}
}
+ if ((Args.hasArg(OPT_fsycl_is_device) || Args.hasArg(OPT_fsycl_is_host)) &&
+ !Args.hasArg(OPT_sycl_std_EQ)) {
+ // If the user supplied -fsycl-is-device or -fsycl-is-host, but failed to
+ // provide -sycl-std=, we want to default it to whatever the default SYCL
+ // version is. I could not find a way to express this with the options
+ // tablegen because we still want this value to be SYCL_None when the user
+ // is not in device or host mode.
+ Opts.setSYCLVersion(LangOptions::SYCL_Default);
+ }
+
if (Opts.ObjC) {
if (Arg *arg = Args.getLastArg(OPT_fobjc_runtime_EQ)) {
StringRef value = arg->getValue();