rnk added a comment.

It feels like the right thing is to disable EH in device side compilation, but 
obviously that won't work because it would reject try/throw in host code. I 
think instead of doing that, we should make sure that CUDA diagnoses try / 
catch / throw in device functions, and then do what you've done here.

Also, take a look at CodeGenFunction::getInvokeDestImpl(). I think you should 
add some checks in there to return nullptr if we're doing a device-side CUDA 
compilation. That's a much more direct way to ensure we never generate invokes 
on the device side.



> SemaDecl.cpp:12082
> +        (getLangOpts().CUDAIsDevice && T == CFT_HostDevice))
> +      FD->addAttr(NoThrowAttr::CreateImplicit(Context, FD->getLocation()));
> +  }

Can we use a `noexcept` exception specification instead of this GCC attribute?

https://reviews.llvm.org/D25166



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to