summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetInstrInfo.cpp
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2017-04-13 14:10:52 +0000
committerSerge Pavlov <sepavloff@gmail.com>2017-04-13 14:10:52 +0000
commit49acf9c8ebba8deada0d22524c0482848d5de486 (patch)
tree38056d09a32f30bd2cdf9f6f5ddbdf6c65631bb5 /llvm/lib/CodeGen/TargetInstrInfo.cpp
parente32a66b2de3ce7dec25f32b46974880b9ce20875 (diff)
downloadbcm5719-llvm-49acf9c8ebba8deada0d22524c0482848d5de486.tar.gz
bcm5719-llvm-49acf9c8ebba8deada0d22524c0482848d5de486.zip
Use methods to access data stored with frame instructions
Instructions CALLSEQ_START..CALLSEQ_END and their target dependent counterparts keep data like frame size, stack adjustment etc. These data are accessed by getOperand using hard coded indices. It is error prone way. This change implements the access by special methods, which improve readability and allow changing data representation without massive changes of index values. Differential Revision: https://reviews.llvm.org/D31953 llvm-svn: 300196
Diffstat (limited to 'llvm/lib/CodeGen/TargetInstrInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetInstrInfo.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/TargetInstrInfo.cpp b/llvm/lib/CodeGen/TargetInstrInfo.cpp
index ef766db756e..711144a3474 100644
--- a/llvm/lib/CodeGen/TargetInstrInfo.cpp
+++ b/llvm/lib/CodeGen/TargetInstrInfo.cpp
@@ -941,12 +941,10 @@ int TargetInstrInfo::getSPAdjust(const MachineInstr &MI) const {
unsigned FrameSetupOpcode = getCallFrameSetupOpcode();
unsigned FrameDestroyOpcode = getCallFrameDestroyOpcode();
- if (MI.getOpcode() != FrameSetupOpcode &&
- MI.getOpcode() != FrameDestroyOpcode)
+ if (!isFrameInstr(MI))
return 0;
- int SPAdj = MI.getOperand(0).getImm();
- SPAdj = TFI->alignSPAdjust(SPAdj);
+ int SPAdj = TFI->alignSPAdjust(getFrameSize(MI));
if ((!StackGrowsDown && MI.getOpcode() == FrameSetupOpcode) ||
(StackGrowsDown && MI.getOpcode() == FrameDestroyOpcode))
OpenPOWER on IntegriCloud