aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/XCore/XCoreFrameLowering.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-10-09 00:34:19 +0000
committerBill Wendling <isanbard@gmail.com>2012-10-09 00:34:19 +0000
commit341873ae0224f79c8ac17bd90562820cbfb67824 (patch)
tree68f1f7a685bc40874373e747b19edbb7dd563f7e /lib/Target/XCore/XCoreFrameLowering.cpp
parent060f20a0fa73d04b871e273fbf7b3e49a3e78b73 (diff)
downloadexternal_llvm-341873ae0224f79c8ac17bd90562820cbfb67824.zip
external_llvm-341873ae0224f79c8ac17bd90562820cbfb67824.tar.gz
external_llvm-341873ae0224f79c8ac17bd90562820cbfb67824.tar.bz2
Use an iterator and proper query method instead of the 'hasAttrSomewhere' method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/XCore/XCoreFrameLowering.cpp')
-rw-r--r--lib/Target/XCore/XCoreFrameLowering.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Target/XCore/XCoreFrameLowering.cpp b/lib/Target/XCore/XCoreFrameLowering.cpp
index fc67177..6d98b44 100644
--- a/lib/Target/XCore/XCoreFrameLowering.cpp
+++ b/lib/Target/XCore/XCoreFrameLowering.cpp
@@ -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();