attribute for a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49373
91177308-0d34-0410-b5e6-
96231b3b80d8
/// @brief Determine if the function cannot return.
bool doesNotReturn() const { return paramHasAttr(0, ParamAttr::NoReturn); }
+ void setDoesNotThrow(bool doesNotThrow = true);
/// @brief Determine if the function cannot unwind.
bool doesNotThrow() const {
BasicBlocks.clear(); // Delete all basic blocks...
}
+void Function::setDoesNotThrow(bool doesNotThrow) {
+ PAListPtr PAL = getParamAttrs();
+ if (doesNotThrow)
+ PAL = PAL.addAttr(0, ParamAttr::NoUnwind);
+ else
+ PAL = PAL.removeAttr(0, ParamAttr::NoUnwind);
+ setParamAttrs(PAL);
+}
+
// Maintain the collector name for each function in an on-the-side table. This
// saves allocating an additional word in Function for programs which do not use
// GC (i.e., most programs) at the cost of increased overhead for clients which