summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitcb4b567f0a2abb3d24cb63a1fee4ba845b0d15a3 (patch)
tree06fa16587fd9af772a481676d0fbe0abe47bdeac /llvm/lib/Target/XCore/XCoreFrameLowering.cpp
parent375eb1f9807e89289d4668471cedddf72eb6dd7b (diff)
downloadbcm5719-llvm-cb4b567f0a2abb3d24cb63a1fee4ba845b0d15a3.tar.gz
bcm5719-llvm-cb4b567f0a2abb3d24cb63a1fee4ba845b0d15a3.zip
Use an iterator and proper query method instead of the 'hasAttrSomewhere' method.
llvm-svn: 165467
Diffstat (limited to 'llvm/lib/Target/XCore/XCoreFrameLowering.cpp')
-rw-r--r--llvm/lib/Target/XCore/XCoreFrameLowering.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Target/XCore/XCoreFrameLowering.cpp b/llvm/lib/Target/XCore/XCoreFrameLowering.cpp
index fc6717736ad..6d98b44a37e 100644
--- a/llvm/lib/Target/XCore/XCoreFrameLowering.cpp
+++ b/llvm/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();
OpenPOWER on IntegriCloud