================
@@ -6591,6 +6681,18 @@ const ToolChain &Driver::getOffloadingDeviceToolChain(
                                                            HostTC, Args);
       break;
     }
+    case Action::OFK_SYCL:
+      switch (Target.getArch()) {
+      case llvm::Triple::spir:
+      case llvm::Triple::spir64:
+      case llvm::Triple::spirv32:
+      case llvm::Triple::spirv64:
+        TC = std::make_unique<toolchains::SYCLToolChain>(*this, Target, HostTC,
+                                                         Args);
+        break;
+      default:
+        break;
+      }
     default:
       break;
----------------
tahonermann wrote:

There is an unconditional dereference of `TC` below and `TC` is known to be 
null in these default cases (as well as when neither of the `if` branches is 
taken for the `Action::OFK_HIP` case above). I think we should at least assert 
that `TC` is non-null below. Presumably these default cases (as well as the 
control flow path that doesn't assign `TC` in the `OFK_HIP` case) are intended 
to be unreachable, so an alternative is to add `llvm_unreachable()` calls in 
these locations.

https://github.com/llvm/llvm-project/pull/117268
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to