MandarinInstrInfo.cpp
/// storeRegToStackSlot - Store the specified register of the given register
/// class to the specified stack frame index. The store instruction is to be
/// added to the given machine basic block before the specified machine
/// instruction. If isKill is true, the register operand is the last use and
/// must be marked kill.
Store the specified register of the given register
class to the specified stack frame index. The store instruction is to be
added to the given machine basic block before the specified machine
instruction. If isKill is true, the register operand is the last use and
must be marked kill.
Store the specified register of the given register class to the specified stack frame index . The store instruction is to be added to the given machine basic block before the specified machine instruction . If isKill is true the register operand is the last use and must be marked kill .
void MandarinInstrInfo::
storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
                    unsigned SrcReg, bool isKill, int FrameIndex,
                    const TargetRegisterClass *RC,
                    const TargetRegisterInfo *TRI) const {
	DebugLoc DL;
	if (MI != MBB.end())
		DL = MI->getDebugLoc();
	MachineFunction *MF = MBB.getParent();
	const MachineFrameInfo &MFI = *MF->getFrameInfo();
	MachineMemOperand *MMO =
		MF->getMachineMemOperand(MachinePointerInfo::getFixedStack(FrameIndex),
								MachineMemOperand::MOStore,
								MFI.getObjectSize(FrameIndex),
								MFI.getObjectAlignment(FrameIndex));
	if (RC == &MD::GenericRegsRegClass)
	{
		BuildMI(MBB, MI, DL, get(MD::STORErr))
		  .addFrameIndex(FrameIndex).addImm(0)
		  .addReg(SrcReg, getKillRegState(isKill)).addMemOperand(MMO);
	}else{
		llvm_unreachable("Cannot store this register to stack slot!");
	}
}
void MandarinInstrInfo :: storeRegToStackSlot ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator MI , unsigned SrcReg , bool isKill , int FrameIndex , const TargetRegisterClass * RC , const TargetRegisterInfo * TRI ) const { DebugLoc DL ; if ( MI != MBB . end ( ) ) DL = MI -> getDebugLoc ( ) ; MachineFunction * MF = MBB . getParent ( ) ; const MachineFrameInfo & MFI = * MF -> getFrameInfo ( ) ; MachineMemOperand * MMO = MF -> getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( FrameIndex ) , MachineMemOperand :: MOStore , MFI . getObjectSize ( FrameIndex ) , MFI . getObjectAlignment ( FrameIndex ) ) ; if ( RC == & MD :: GenericRegsRegClass ) { BuildMI ( MBB , MI , DL , get ( MD :: STORErr ) ) . addFrameIndex ( FrameIndex ) . addImm ( 0 ) . addReg ( SrcReg , getKillRegState ( isKill ) ) . addMemOperand ( MMO ) ; } else { llvm_unreachable ( " " ) ; } }
storeRegToStackSlot - Store the specified register of the given register
class to the specified stack frame index.
storeRegToStackSlot - Store the specified register of the given register class to the specified stack frame index .