summaryrefslogtreecommitdiff
path: root/include/llvm/Instructions.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Instructions.h')
-rw-r--r--include/llvm/Instructions.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index 34b22c7802..2d721bb414 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -927,6 +927,21 @@ public:
/// @brief Determine whether the call or the callee has the given attribute.
bool paramHasAttr(uint16_t i, ParameterAttributes attr) const;
+ /// @brief Determine if the call does not access memory.
+ bool doesNotAccessMemory() const {
+ return paramHasAttr(0, ParamAttr::ReadNone);
+ }
+
+ /// @brief Determine if the call does not access or only reads memory.
+ bool onlyReadsMemory() const {
+ return doesNotAccessMemory() || paramHasAttr(0, ParamAttr::ReadOnly);
+ }
+
+ /// @brief Determine if the call cannot unwind.
+ bool isNoUnwind() const {
+ return paramHasAttr(0, ParamAttr::NoUnwind);
+ }
+
/// @brief Determine if the call returns a structure.
bool isStructReturn() const {
// Be friendly and also check the callee.
@@ -1711,6 +1726,21 @@ public:
/// @brief Determine whether the call or the callee has the given attribute.
bool paramHasAttr(uint16_t i, ParameterAttributes attr) const;
+ /// @brief Determine if the call does not access memory.
+ bool doesNotAccessMemory() const {
+ return paramHasAttr(0, ParamAttr::ReadNone);
+ }
+
+ /// @brief Determine if the call does not access or only reads memory.
+ bool onlyReadsMemory() const {
+ return doesNotAccessMemory() || paramHasAttr(0, ParamAttr::ReadOnly);
+ }
+
+ /// @brief Determine if the call cannot unwind.
+ bool isNoUnwind() const {
+ return paramHasAttr(0, ParamAttr::NoUnwind);
+ }
+
/// @brief Determine if the call returns a structure.
bool isStructReturn() const {
// Be friendly and also check the callee.