llvm.org GIT mirror llvm / 987e8ba
Add support for frame and constant pool references git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5228 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
1 changed file(s) with 16 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
4141
4242 /// addFrameReference - This function is used to add a reference to the base of
4343 /// 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.
44 /// reference has base register as the FrameIndex offset until it is resolved.
45 /// This allows a constant offset to be specified as well...
4646 ///
4747 inline const MachineInstrBuilder &
48 addFrameReference(const MachineInstrBuilder &MIB, int FI) {
49 return MIB.addReg(0).addZImm(1).addMReg(0).addFrameIndex(FI);
48 addFrameReference(const MachineInstrBuilder &MIB, int FI, int Offset = 0) {
49 return MIB.addFrameIndex(FI).addZImm(1).addMReg(0).addSImm(Offset);
50 }
51
52 /// addConstantPoolReference - This function is used to add a reference to the
53 /// base of a constant value spilled to the per-function constant pool. The
54 /// reference has base register ConstantPoolIndex offset which is retained until
55 /// either machine code emission or assembly output. This allows an optional
56 /// offset to be added as well.
57 ///
58 inline const MachineInstrBuilder &
59 addConstantPoolReference(const MachineInstrBuilder &MIB, unsigned CPI,
60 int Offset = 0) {
61 return MIB.addConstantPoolIndex(CPI).addZImm(1).addMReg(0).addSImm(Offset);
5062 }
5163
5264 #endif