+ return doesNotAccessMemory() || paramHasAttr(~0, Attribute::ReadOnly);
+ }
+ void setOnlyReadsMemory(bool OnlyReadsMemory = true) {
+ if (OnlyReadsMemory) addAttribute(~0, Attribute::ReadOnly);
+ else removeAttribute(~0, Attribute::ReadOnly | Attribute::ReadNone);
+ }
+
+ /// @brief Determine if the function cannot return.
+ bool doesNotReturn() const {
+ return paramHasAttr(~0, Attribute::NoReturn);
+ }
+ void setDoesNotReturn(bool DoesNotReturn = true) {
+ if (DoesNotReturn) addAttribute(~0, Attribute::NoReturn);
+ else removeAttribute(~0, Attribute::NoReturn);
+ }
+
+ /// @brief Determine if the function cannot unwind.
+ bool doesNotThrow() const {
+ return paramHasAttr(~0, Attribute::NoUnwind);
+ }
+ void setDoesNotThrow(bool DoesNotThrow = true) {
+ if (DoesNotThrow) addAttribute(~0, Attribute::NoUnwind);
+ else removeAttribute(~0, Attribute::NoUnwind);