mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 20:26:07 +00:00
Add some helpers for manipulating function
parameter attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53228 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -113,16 +113,13 @@ bool Argument::hasStructRetAttr() const {
|
||||
|
||||
/// addAttr - Add a ParamAttr to an argument
|
||||
void Argument::addAttr(ParameterAttributes attr) {
|
||||
getParent()->setParamAttrs(
|
||||
getParent()->getParamAttrs().addAttr(getArgNo() + 1, attr));
|
||||
}
|
||||
|
||||
/// removeAttr - Remove a ParamAttr from an argument
|
||||
void Argument::removeAttr(ParameterAttributes attr) {
|
||||
getParent()->setParamAttrs(
|
||||
getParent()->getParamAttrs().removeAttr(getArgNo() + 1, attr));
|
||||
getParent()->addParamAttr(getArgNo() + 1, attr);
|
||||
}
|
||||
|
||||
/// removeAttr - Remove a ParamAttr from an argument
|
||||
void Argument::removeAttr(ParameterAttributes attr) {
|
||||
getParent()->removeParamAttr(getArgNo() + 1, attr);
|
||||
}
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
@@ -231,21 +228,18 @@ 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);
|
||||
}
|
||||
|
||||
void Function::addParamAttr(unsigned i, ParameterAttributes attr) {
|
||||
PAListPtr PAL = getParamAttrs();
|
||||
PAL = PAL.addAttr(i, attr);
|
||||
setParamAttrs(PAL);
|
||||
}
|
||||
|
||||
void Function::removeParamAttr(unsigned i, ParameterAttributes attr) {
|
||||
PAListPtr PAL = getParamAttrs();
|
||||
PAL = PAL.removeAttr(i, attr);
|
||||
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
|
||||
|
Reference in New Issue
Block a user