llvm.org GIT mirror llvm / a1826c2
New addFrameReference function git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5182 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
1 changed file(s) with 18 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
1919 #include "llvm/CodeGen/MachineInstrBuilder.h"
2020
2121 /// addDirectMem - This function is used to add a direct memory reference to the
22 /// current instruction -- that is, a dereference of an address in a register, with
23 /// no scale, index or displacement. An example is: DWORD PTR [EAX].
22 /// current instruction -- that is, a dereference of an address in a register,
23 /// with no scale, index or displacement. An example is: DWORD PTR [EAX].
24 ///
2425 inline const MachineInstrBuilder &addDirectMem(const MachineInstrBuilder &MIB,
2526 unsigned Reg) {
2627 // Because memory references are always represented with four
2930 }
3031
3132
32 /// addRegOffset - This function is used to add a memory reference of
33 /// the form [Reg + Offset], i.e., one with no scale or index, but
34 /// with a displacement. An example is: DWORD PTR [EAX + 4].
33 /// addRegOffset - This function is used to add a memory reference of the form
34 /// [Reg + Offset], i.e., one with no scale or index, but with a
35 /// displacement. An example is: DWORD PTR [EAX + 4].
36 ///
3537 inline const MachineInstrBuilder &addRegOffset(const MachineInstrBuilder &MIB,
36 unsigned Reg, unsigned Offset) {
38 unsigned Reg, int Offset) {
3739 return MIB.addReg(Reg).addZImm(1).addMReg(0).addSImm(Offset);
3840 }
3941
42 /// addFrameReference - This function is used to add a reference to the base of
43 /// an abstract object on the stack frame of the current function. This
44 /// reference has base register and a FrameIndex offset until it is
45 /// resolved.
46 ///
47 inline const MachineInstrBuilder &
48 addFrameReference(const MachineInstrBuilder &MIB, int FI) {
49 return MIB.addReg(0).addZImm(1).addMReg(0).addFrameIndex(FI);
50 }
51
4052 #endif