aboutsummaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm')
-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);