LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TargetFrameLoweringImpl.cpp
Go to the documentation of this file.
1 //===----- TargetFrameLoweringImpl.cpp - Implement target frame interface --==//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Implements the layout of a stack frame on the target machine.
11 //
12 //===----------------------------------------------------------------------===//
13 
19 #include <cstdlib>
20 using namespace llvm;
21 
23 }
24 
25 /// getFrameIndexOffset - Returns the displacement from the frame register to
26 /// the stack frame of the specified index. This is the default implementation
27 /// which is overridden for some targets.
29  int FI) const {
30  const MachineFrameInfo *MFI = MF.getFrameInfo();
31  return MFI->getObjectOffset(FI) + MFI->getStackSize() -
33 }
34 
36  int FI, unsigned &FrameReg) const {
37  const TargetRegisterInfo *RI = MF.getTarget().getRegisterInfo();
38 
39  // By default, assume all frame indices are referenced via whatever
40  // getFrameRegister() says. The target can override this if it's doing
41  // something different.
42  FrameReg = RI->getFrameRegister(MF);
43  return getFrameIndexOffset(MF, FI);
44 }
uint64_t getStackSize() const
Abstract Stack Frame Information.
virtual unsigned getFrameRegister(const MachineFunction &MF) const =0
Debug information queries.
int getOffsetAdjustment() const
virtual int getFrameIndexReference(const MachineFunction &MF, int FI, unsigned &FrameReg) const
int64_t getObjectOffset(int ObjectIdx) const
virtual int getFrameIndexOffset(const MachineFunction &MF, int FI) const
MachineFrameInfo * getFrameInfo()
const TargetMachine & getTarget() const
virtual const TargetRegisterInfo * getRegisterInfo() const