[llvm-commits] [llvm] r165467 - /llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp
Bill Wendling
isanbard at gmail.com
Mon Oct 8 17:34:20 PDT 2012
Author: void
Date: Mon Oct 8 19:34:19 2012
New Revision: 165467
URL: http://llvm.org/viewvc/llvm-project?rev=165467&view=rev
Log:
Use an iterator and proper query method instead of the 'hasAttrSomewhere' method.
Modified:
llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp
Modified: llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp?rev=165467&r1=165466&r2=165467&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreFrameLowering.cpp Mon Oct 8 19:34:19 2012
@@ -98,12 +98,13 @@
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();
More information about the llvm-commits
mailing list