diff options
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 276d91f..dfa5521 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -1969,11 +1969,11 @@ void CodeGenModule::getDefaultFunctionAttributes(StringRef Name, FuncAttrs.addAttribute(llvm::Attribute::Convergent); } - // TODO: NoUnwind attribute should be added for other GPU modes OpenCL, HIP, + // TODO: NoUnwind attribute should be added for other GPU modes HIP, // SYCL, OpenMP offload. AFAIK, none of them support exceptions in device // code. - if (getLangOpts().CUDA && getLangOpts().CUDAIsDevice) { - // Exceptions aren't supported in CUDA device code. + if ((getLangOpts().CUDA && getLangOpts().CUDAIsDevice) || + getLangOpts().OpenCL) { FuncAttrs.addAttribute(llvm::Attribute::NoUnwind); } |