aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-12-10 19:09:40 +0000
committerDuncan Sands <baldrick@free.fr>2007-12-10 19:09:40 +0000
commitcbb8badce8838ece47cb806a0399c77d76a7e11b (patch)
tree778a2f778908ed6a3d1f6aee778559a87954d383 /include
parent1eff70451fbb079c1d5b8f45ff8c8a2b8f74d7ba (diff)
Make PruneEH update the nounwind/noreturn attributes
on functions as it calculates them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44802 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Function.h10
-rw-r--r--include/llvm/Instructions.h10
2 files changed, 20 insertions, 0 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h
index ece095d380..2abde45f8b 100644
--- a/include/llvm/Function.h
+++ b/include/llvm/Function.h
@@ -165,6 +165,16 @@ public:
return ParamAttrs && ParamAttrs->paramHasAttr(i, attr);
}
+ /// @brief Determine if the function cannot return.
+ bool isNoReturn() const {
+ return paramHasAttr(0, ParamAttr::NoReturn);
+ }
+
+ /// @brief Determine if the function cannot unwind.
+ bool isNoUnwind() const {
+ return paramHasAttr(0, ParamAttr::NoUnwind);
+ }
+
/// @brief Determine if the function does not access memory.
bool doesNotAccessMemory() const {
return paramHasAttr(0, ParamAttr::ReadNone);
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index 2d721bb414..bc5e0b4af9 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -937,6 +937,11 @@ public:
return doesNotAccessMemory() || paramHasAttr(0, ParamAttr::ReadOnly);
}
+ /// @brief Determine if the call cannot return.
+ bool isNoReturn() const {
+ return paramHasAttr(0, ParamAttr::NoReturn);
+ }
+
/// @brief Determine if the call cannot unwind.
bool isNoUnwind() const {
return paramHasAttr(0, ParamAttr::NoUnwind);
@@ -1736,6 +1741,11 @@ public:
return doesNotAccessMemory() || paramHasAttr(0, ParamAttr::ReadOnly);
}
+ /// @brief Determine if the call cannot return.
+ bool isNoReturn() const {
+ return paramHasAttr(0, ParamAttr::NoReturn);
+ }
+
/// @brief Determine if the call cannot unwind.
bool isNoUnwind() const {
return paramHasAttr(0, ParamAttr::NoUnwind);