summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2017-04-19 03:12:05 +0000
committerSerge Pavlov <sepavloff@gmail.com>2017-04-19 03:12:05 +0000
commit5943a96d81544d23c778d3120e67cb75c3208140 (patch)
tree667119f150c3187be2746c2d0d613e7eee8a347d /llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
parent94c17081101920661fe8f8cf7f7ff685d9cbc668 (diff)
downloadbcm5719-llvm-5943a96d81544d23c778d3120e67cb75c3208140.tar.gz
bcm5719-llvm-5943a96d81544d23c778d3120e67cb75c3208140.zip
ARM: Use methods to access data stored with frame instructions
In r300196 several methods were added to TarfetInstrInfo to access data stored with call frame setup/destroy instructions. This change replaces calls to getOperand with calls to such special methods in ARM target. Differential Revision: https://reviews.llvm.org/D32127 llvm-svn: 300655
Diffstat (limited to 'llvm/lib/Target/ARM/Thumb1FrameLowering.cpp')
-rw-r--r--llvm/lib/Target/ARM/Thumb1FrameLowering.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp b/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
index fc083b98395..d0fd366ab9e 100644
--- a/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
+++ b/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
@@ -83,13 +83,12 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
// ADJCALLSTACKUP -> add, sp, sp, amount
MachineInstr &Old = *I;
DebugLoc dl = Old.getDebugLoc();
- unsigned Amount = Old.getOperand(0).getImm();
+ unsigned Amount = TII.getFrameSize(Old);
if (Amount != 0) {
// We need to keep the stack aligned properly. To do this, we round the
// amount of space needed for the outgoing arguments up to the next
// alignment boundary.
- unsigned Align = getStackAlignment();
- Amount = (Amount+Align-1)/Align*Align;
+ Amount = alignTo(Amount, getStackAlignment());
// Replace the pseudo instruction with a new instruction...
unsigned Opc = Old.getOpcode();
OpenPOWER on IntegriCloud