Use an iterator and proper query method instead of the 'hasAttrSomewhere' method.
authorBill Wendling <isanbard@gmail.com>
Tue, 9 Oct 2012 00:34:19 +0000 (00:34 +0000)
committerBill Wendling <isanbard@gmail.com>
Tue, 9 Oct 2012 00:34:19 +0000 (00:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165467 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/XCore/XCoreFrameLowering.cpp

index fc6717736add48e4d8bfd467119b8de405522281..6d98b44a37ecef68d8f2b7940dfa20250d13573d 100644 (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();