mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-18 12:29:27 +00:00
Add functions to enable adding a single attribute to a function and
its associated call site. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51204 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ea7dd40714
commit
0bf7b414ae
@ -171,6 +171,9 @@ public:
|
|||||||
return ParamAttrs.paramHasAttr(i, attr);
|
return ParamAttrs.paramHasAttr(i, attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// addParamAttr - adds the attribute to the list of attributes.
|
||||||
|
void addParamAttr(unsigned i, ParameterAttributes attr);
|
||||||
|
|
||||||
/// @brief Extract the alignment for a call or parameter (0=unknown).
|
/// @brief Extract the alignment for a call or parameter (0=unknown).
|
||||||
unsigned getParamAlignment(unsigned i) const {
|
unsigned getParamAlignment(unsigned i) const {
|
||||||
return ParamAttrs.getParamAlignment(i);
|
return ParamAttrs.getParamAlignment(i);
|
||||||
|
@ -1110,6 +1110,9 @@ public:
|
|||||||
/// setParamAttrs - Sets the parameter attributes for this call.
|
/// setParamAttrs - Sets the parameter attributes for this call.
|
||||||
void setParamAttrs(const PAListPtr &Attrs) { ParamAttrs = Attrs; }
|
void setParamAttrs(const PAListPtr &Attrs) { ParamAttrs = Attrs; }
|
||||||
|
|
||||||
|
/// addParamAttr - adds the attribute to the list of attributes.
|
||||||
|
void addParamAttr(unsigned i, ParameterAttributes attr);
|
||||||
|
|
||||||
/// @brief Determine whether the call or the callee has the given attribute.
|
/// @brief Determine whether the call or the callee has the given attribute.
|
||||||
bool paramHasAttr(unsigned i, unsigned attr) const;
|
bool paramHasAttr(unsigned i, unsigned attr) const;
|
||||||
|
|
||||||
@ -2429,6 +2432,9 @@ public:
|
|||||||
/// @brief Determine whether the call or the callee has the given attribute.
|
/// @brief Determine whether the call or the callee has the given attribute.
|
||||||
bool paramHasAttr(unsigned i, ParameterAttributes attr) const;
|
bool paramHasAttr(unsigned i, ParameterAttributes attr) const;
|
||||||
|
|
||||||
|
/// addParamAttr - adds the attribute to the list of attributes.
|
||||||
|
void addParamAttr(unsigned i, ParameterAttributes attr);
|
||||||
|
|
||||||
/// @brief Extract the alignment for a call or parameter (0=unknown).
|
/// @brief Extract the alignment for a call or parameter (0=unknown).
|
||||||
unsigned getParamAlignment(unsigned i) const {
|
unsigned getParamAlignment(unsigned i) const {
|
||||||
return ParamAttrs.getParamAlignment(i);
|
return ParamAttrs.getParamAlignment(i);
|
||||||
|
@ -240,6 +240,12 @@ void Function::setDoesNotThrow(bool doesNotThrow) {
|
|||||||
setParamAttrs(PAL);
|
setParamAttrs(PAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Function::addParamAttr(unsigned i, ParameterAttributes attr) {
|
||||||
|
PAListPtr PAL = getParamAttrs();
|
||||||
|
PAL = PAL.addAttr(i, attr);
|
||||||
|
setParamAttrs(PAL);
|
||||||
|
}
|
||||||
|
|
||||||
// Maintain the collector name for each function in an on-the-side table. This
|
// 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
|
// 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
|
// GC (i.e., most programs) at the cost of increased overhead for clients which
|
||||||
|
@ -373,6 +373,12 @@ CallInst::CallInst(const CallInst &CI)
|
|||||||
OL[i].init(InOL[i], this);
|
OL[i].init(InOL[i], this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CallInst::addParamAttr(unsigned i, ParameterAttributes attr) {
|
||||||
|
PAListPtr PAL = getParamAttrs();
|
||||||
|
PAL = PAL.addAttr(i, attr);
|
||||||
|
setParamAttrs(PAL);
|
||||||
|
}
|
||||||
|
|
||||||
bool CallInst::paramHasAttr(unsigned i, ParameterAttributes attr) const {
|
bool CallInst::paramHasAttr(unsigned i, ParameterAttributes attr) const {
|
||||||
if (ParamAttrs.paramHasAttr(i, attr))
|
if (ParamAttrs.paramHasAttr(i, attr))
|
||||||
return true;
|
return true;
|
||||||
@ -449,6 +455,12 @@ bool InvokeInst::paramHasAttr(unsigned i, ParameterAttributes attr) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InvokeInst::addParamAttr(unsigned i, ParameterAttributes attr) {
|
||||||
|
PAListPtr PAL = getParamAttrs();
|
||||||
|
PAL = PAL.addAttr(i, attr);
|
||||||
|
setParamAttrs(PAL);
|
||||||
|
}
|
||||||
|
|
||||||
void InvokeInst::setDoesNotThrow(bool doesNotThrow) {
|
void InvokeInst::setDoesNotThrow(bool doesNotThrow) {
|
||||||
PAListPtr PAL = getParamAttrs();
|
PAListPtr PAL = getParamAttrs();
|
||||||
if (doesNotThrow)
|
if (doesNotThrow)
|
||||||
|
Loading…
Reference in New Issue
Block a user