mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-22 10:24:26 +00:00
Remove the getAttributesAtIndex and getNumAttrs methods in favor of using the getAttrSomewhere predicate. This prevents the uses of 'Attribute' as a collection of attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171271 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -358,9 +358,6 @@ public:
|
|||||||
/// parameter or for the return value.
|
/// parameter or for the return value.
|
||||||
bool hasAttrSomewhere(Attribute::AttrKind Attr) const;
|
bool hasAttrSomewhere(Attribute::AttrKind Attr) const;
|
||||||
|
|
||||||
unsigned getNumAttrs() const;
|
|
||||||
Attribute &getAttributesAtIndex(unsigned i) const;
|
|
||||||
|
|
||||||
/// operator==/!= - Provide equality predicates.
|
/// operator==/!= - Provide equality predicates.
|
||||||
bool operator==(const AttributeSet &RHS) const {
|
bool operator==(const AttributeSet &RHS) const {
|
||||||
return AttrList == RHS.AttrList;
|
return AttrList == RHS.AttrList;
|
||||||
|
@ -1352,10 +1352,7 @@ public:
|
|||||||
|
|
||||||
/// \brief Determine if any call argument is an aggregate passed by value.
|
/// \brief Determine if any call argument is an aggregate passed by value.
|
||||||
bool hasByValArgument() const {
|
bool hasByValArgument() const {
|
||||||
for (unsigned I = 0, E = AttributeList.getNumAttrs(); I != E; ++I)
|
return AttributeList.hasAttrSomewhere(Attribute::ByVal);
|
||||||
if (AttributeList.getAttributesAtIndex(I).hasAttribute(Attribute::ByVal))
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getCalledFunction - Return the function called, or null if this is an
|
/// getCalledFunction - Return the function called, or null if this is an
|
||||||
@ -3092,10 +3089,7 @@ public:
|
|||||||
|
|
||||||
/// \brief Determine if any call argument is an aggregate passed by value.
|
/// \brief Determine if any call argument is an aggregate passed by value.
|
||||||
bool hasByValArgument() const {
|
bool hasByValArgument() const {
|
||||||
for (unsigned I = 0, E = AttributeList.getNumAttrs(); I != E; ++I)
|
return AttributeList.hasAttrSomewhere(Attribute::ByVal);
|
||||||
if (AttributeList.getAttributesAtIndex(I).hasAttribute(Attribute::ByVal))
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getCalledFunction - Return the function called, or null if this is an
|
/// getCalledFunction - Return the function called, or null if this is an
|
||||||
|
@ -100,11 +100,8 @@ void XCoreFrameLowering::emitPrologue(MachineFunction &MF) const {
|
|||||||
bool FP = hasFP(MF);
|
bool FP = hasFP(MF);
|
||||||
const AttributeSet &PAL = MF.getFunction()->getAttributes();
|
const AttributeSet &PAL = MF.getFunction()->getAttributes();
|
||||||
|
|
||||||
for (unsigned I = 0, E = PAL.getNumAttrs(); I != E; ++I)
|
if (PAL.hasAttrSomewhere(Attribute::Nest))
|
||||||
if (PAL.getAttributesAtIndex(I).hasAttribute(Attribute::Nest)) {
|
|
||||||
loadFromStack(MBB, MBBI, XCore::R11, 0, dl, TII);
|
loadFromStack(MBB, MBBI, XCore::R11, 0, dl, TII);
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Work out frame sizes.
|
// Work out frame sizes.
|
||||||
int FrameSize = MFI->getStackSize();
|
int FrameSize = MFI->getStackSize();
|
||||||
|
@ -1248,8 +1248,7 @@ InstCombiner::transformCallThroughTrampoline(CallSite CS,
|
|||||||
|
|
||||||
// If the call already has the 'nest' attribute somewhere then give up -
|
// If the call already has the 'nest' attribute somewhere then give up -
|
||||||
// otherwise 'nest' would occur twice after splicing in the chain.
|
// otherwise 'nest' would occur twice after splicing in the chain.
|
||||||
for (unsigned I = 0, E = Attrs.getNumAttrs(); I != E; ++I)
|
if (Attrs.hasAttrSomewhere(Attribute::Nest))
|
||||||
if (Attrs.getAttributesAtIndex(I).hasAttribute(Attribute::Nest))
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
assert(Tramp &&
|
assert(Tramp &&
|
||||||
|
@ -478,7 +478,7 @@ uint64_t AttributeSet::getBitMask(unsigned Index) const {
|
|||||||
Attribute AttributeSet::getAttributes(unsigned Idx) const {
|
Attribute AttributeSet::getAttributes(unsigned Idx) const {
|
||||||
if (AttrList == 0) return Attribute();
|
if (AttrList == 0) return Attribute();
|
||||||
|
|
||||||
const SmallVector<AttributeWithIndex, 4> &Attrs = AttrList->Attrs;
|
const SmallVectorImpl<AttributeWithIndex> &Attrs = AttrList->Attrs;
|
||||||
for (unsigned i = 0, e = Attrs.size(); i != e && Attrs[i].Index <= Idx; ++i)
|
for (unsigned i = 0, e = Attrs.size(); i != e && Attrs[i].Index <= Idx; ++i)
|
||||||
if (Attrs[i].Index == Idx)
|
if (Attrs[i].Index == Idx)
|
||||||
return Attrs[i].Attrs;
|
return Attrs[i].Attrs;
|
||||||
@ -499,16 +499,6 @@ bool AttributeSet::hasAttrSomewhere(Attribute::AttrKind Attr) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned AttributeSet::getNumAttrs() const {
|
|
||||||
return AttrList ? AttrList->Attrs.size() : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Attribute &AttributeSet::getAttributesAtIndex(unsigned i) const {
|
|
||||||
assert(AttrList && "Trying to get an attribute from an empty list!");
|
|
||||||
assert(i < AttrList->Attrs.size() && "Index out of range!");
|
|
||||||
return AttrList->Attrs[i].Attrs;
|
|
||||||
}
|
|
||||||
|
|
||||||
AttributeSet AttributeSet::addAttr(LLVMContext &C, unsigned Idx,
|
AttributeSet AttributeSet::addAttr(LLVMContext &C, unsigned Idx,
|
||||||
Attribute Attrs) const {
|
Attribute Attrs) const {
|
||||||
Attribute OldAttrs = getAttributes(Idx);
|
Attribute OldAttrs = getAttributes(Idx);
|
||||||
|
Reference in New Issue
Block a user