mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-05 12:31:33 +00:00
Convenience method for setting the nounwind
attribute for a function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49373 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7098772436
commit
92432a8db1
@ -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