mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-22 19:49:49 +00:00
Convenience method for setting the nounwind
attribute for a function. llvm-svn: 49373
This commit is contained in:
parent
7498965b5a
commit
f86399a00f
@ -178,6 +178,7 @@ public:
|
||||
|
||||
/// @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 {
|
||||
|
@ -219,6 +219,15 @@ void Function::dropAllReferences() {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user