================
@@ -858,24 +858,8 @@ Sema::ActOnCXXThrow(Scope *S, SourceLocation OpLoc, Expr
*Ex) {
ExprResult Sema::BuildCXXThrow(SourceLocation OpLoc, Expr *Ex,
bool IsThrownVarInScope) {
- const llvm::Triple &T = Context.getTargetInfo().getTriple();
- const bool IsOpenMPGPUTarget =
- getLangOpts().OpenMPIsTargetDevice && T.isGPU();
-
DiagnoseExceptionUse(OpLoc, /* IsTry= */ false);
- // In OpenMP target regions, we replace 'throw' with a trap on GPU targets.
- if (IsOpenMPGPUTarget)
- targetDiag(OpLoc, diag::warn_throw_not_valid_on_target) << T.str();
-
- // Exceptions aren't allowed in CUDA device code.
- if (getLangOpts().CUDA)
- CUDA().DiagIfDeviceCode(OpLoc, diag::err_cuda_device_exceptions)
- << "throw" << CUDA().CurrentTarget();
-
- if (getCurScope() && getCurScope()->isOpenMPSimdDirectiveScope())
----------------
Sirraide wrote:
Hmm, iiuc, you mean because of this in `DiagnoseExceptionUse()`:
```c++
if (IsOpenMPGPUTarget) {
targetDiag(Loc, diag::warn_exceptions_not_valid_on_target)
<< T.str() << IsTry;
return;
}
```
I missed that this is just a warning; I think we should remove the early
`return` here; if we do that then, I believe we have the same behaviour as
before because the checks as to what diagnostics we should emit here are still
emitted in the same order, except that they’ve all been moved into
`DiagnoseExceptionUse()`.
Or do you have concerns w/ something else here?
https://github.com/llvm/llvm-project/pull/230658
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits