diff options
author | Matthias Braun <matze@braunis.de> | 2016-07-28 18:40:00 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2016-07-28 18:40:00 +0000 |
commit | 941a705b7bf155fc581632ec7d80f22a139bdac0 (patch) | |
tree | cd87202aa17c3e46adca731ccbf7b73ec1b92d81 /llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp | |
parent | 51524b755616c9562a00371b1539784320c0b504 (diff) | |
download | bcm5719-llvm-941a705b7bf155fc581632ec7d80f22a139bdac0.tar.gz bcm5719-llvm-941a705b7bf155fc581632ec7d80f22a139bdac0.zip |
MachineFunction: Return reference for getFrameInfo(); NFC
getFrameInfo() never returns nullptr so we should use a reference
instead of a pointer.
llvm-svn: 277017
Diffstat (limited to 'llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp')
-rw-r--r-- | llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp b/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp index 6c770969e32..e91536ca1e8 100644 --- a/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp +++ b/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp @@ -17,7 +17,7 @@ void XCoreFunctionInfo::anchor() { } bool XCoreFunctionInfo::isLargeFrame(const MachineFunction &MF) const { if (CachedEStackSize == -1) { - CachedEStackSize = MF.getFrameInfo()->estimateStackSize(MF); + CachedEStackSize = MF.getFrameInfo().estimateStackSize(MF); } // isLargeFrame() is used when deciding if spill slots should be added to // allow eliminateFrameIndex() to scavenge registers. @@ -36,12 +36,12 @@ int XCoreFunctionInfo::createLRSpillSlot(MachineFunction &MF) { return LRSpillSlot; } const TargetRegisterClass *RC = &XCore::GRRegsRegClass; - MachineFrameInfo *MFI = MF.getFrameInfo(); + MachineFrameInfo &MFI = MF.getFrameInfo(); if (! MF.getFunction()->isVarArg()) { // A fixed offset of 0 allows us to save / restore LR using entsp / retsp. - LRSpillSlot = MFI->CreateFixedObject(RC->getSize(), 0, true); + LRSpillSlot = MFI.CreateFixedObject(RC->getSize(), 0, true); } else { - LRSpillSlot = MFI->CreateStackObject(RC->getSize(), RC->getAlignment(), true); + LRSpillSlot = MFI.CreateStackObject(RC->getSize(), RC->getAlignment(), true); } LRSpillSlotSet = true; return LRSpillSlot; @@ -52,8 +52,8 @@ int XCoreFunctionInfo::createFPSpillSlot(MachineFunction &MF) { return FPSpillSlot; } const TargetRegisterClass *RC = &XCore::GRRegsRegClass; - MachineFrameInfo *MFI = MF.getFrameInfo(); - FPSpillSlot = MFI->CreateStackObject(RC->getSize(), RC->getAlignment(), true); + MachineFrameInfo &MFI = MF.getFrameInfo(); + FPSpillSlot = MFI.CreateStackObject(RC->getSize(), RC->getAlignment(), true); FPSpillSlotSet = true; return FPSpillSlot; } @@ -63,9 +63,9 @@ const int* XCoreFunctionInfo::createEHSpillSlot(MachineFunction &MF) { return EHSpillSlot; } const TargetRegisterClass *RC = &XCore::GRRegsRegClass; - MachineFrameInfo *MFI = MF.getFrameInfo(); - EHSpillSlot[0] = MFI->CreateStackObject(RC->getSize(), RC->getAlignment(), true); - EHSpillSlot[1] = MFI->CreateStackObject(RC->getSize(), RC->getAlignment(), true); + MachineFrameInfo &MFI = MF.getFrameInfo(); + EHSpillSlot[0] = MFI.CreateStackObject(RC->getSize(), RC->getAlignment(), true); + EHSpillSlot[1] = MFI.CreateStackObject(RC->getSize(), RC->getAlignment(), true); EHSpillSlotSet = true; return EHSpillSlot; } |