summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-10-04 23:41:49 +0000
committerJustin Lebar <jlebar@google.com>2016-10-04 23:41:49 +0000
commit3e6449b4f423c9c4e13974ee5ad909a1475bce63 (patch)
tree63f6e094fbdbae54a2c2025646fbf44101794336 /clang/lib/CodeGen/CGCall.cpp
parent49e7614efb5bad5de8d7bcab0fcd59808db5495d (diff)
downloadbcm5719-llvm-3e6449b4f423c9c4e13974ee5ad909a1475bce63.tar.gz
bcm5719-llvm-3e6449b4f423c9c4e13974ee5ad909a1475bce63.zip
[CUDA] Mark device functions as nounwind.
Summary: This prevents clang from emitting 'invoke's and catch statements. Things previously mostly worked thanks to TryToMarkNoThrow() in CodeGenFunction. But this is not a proper IPO, and it doesn't properly handle cases like mutual recursion. Fixes bug 30593. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25166 llvm-svn: 283272
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index f441bf4eda1..955b86a38b2 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1814,6 +1814,9 @@ void CodeGenModule::ConstructAttributeList(
// them). LLVM will remove this attribute where it safely can.
FuncAttrs.addAttribute(llvm::Attribute::Convergent);
+ // Exceptions aren't supported in CUDA device code.
+ FuncAttrs.addAttribute(llvm::Attribute::NoUnwind);
+
// Respect -fcuda-flush-denormals-to-zero.
if (getLangOpts().CUDADeviceFlushDenormalsToZero)
FuncAttrs.addAttribute("nvptx-f32ftz", "true");
OpenPOWER on IntegriCloud