Use an iterator and proper query method instead of the 'hasAttrSomewhere' method.

llvm-svn: 165467
This commit is contained in:
Bill Wendling 2012-10-09 00:34:19 +00:00
parent 375eb1f980
commit cb4b567f0a
1 changed files with 6 additions and 5 deletions

View File

@ -98,12 +98,13 @@ void XCoreFrameLowering::emitPrologue(MachineFunction &MF) const {
DebugLoc dl = MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc();
bool FP = hasFP(MF);
bool Nested = MF.getFunction()->
getAttributes().hasAttrSomewhere(Attribute::Nest);
const AttrListPtr &PAL = MF.getFunction()->getAttributes();
if (Nested) {
loadFromStack(MBB, MBBI, XCore::R11, 0, dl, TII);
}
for (unsigned I = 0, E = PAL.getNumAttrs(); I != E; ++I)
if (PAL.getAttributesAtIndex(I).hasNestAttr()) {
loadFromStack(MBB, MBBI, XCore::R11, 0, dl, TII);
break;
}
// Work out frame sizes.
int FrameSize = MFI->getStackSize();