MandarinInstrInfo.cpp
/// loadRegFromStackSlot - Load the specified register of the given register
/// class from the specified stack frame index. The load instruction is to be
/// added to the given machine basic block before the specified machine
/// instruction.
Load the specified register of the given register
class from the specified stack frame index. The load instruction is to be
added to the given machine basic block before the specified machine
instruction.
Load the specified register of the given register class from the specified stack frame index . The load instruction is to be added to the given machine basic block before the specified machine instruction .
void MandarinInstrInfo::
loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
                     unsigned DestReg, int FrameIndex,
                     const TargetRegisterClass *RC,
                     const TargetRegisterInfo *TRI) const {
	DebugLoc DL;
	if (MI != MBB.end())
		DL = MI->getDebugLoc();
	MachineFunction &MF = *MBB.getParent();
	MachineFrameInfo &MFI = *MF.getFrameInfo();
	MachineMemOperand *MMO =
		MF.getMachineMemOperand(MachinePointerInfo::getFixedStack(FrameIndex),
								MachineMemOperand::MOLoad,
								MFI.getObjectSize(FrameIndex),
								MFI.getObjectAlignment(FrameIndex));
	if (RC == &MD::GenericRegsRegClass)
	{
		BuildMI(MBB, MI, DL, get(MD::LOADrr), DestReg)
		  .addFrameIndex(FrameIndex).addImm(0).addMemOperand(MMO);
	}else{
		llvm_unreachable("Cannot store this register to stack slot!");
	}
}
void MandarinInstrInfo :: loadRegFromStackSlot ( MachineBasicBlock & MBB , MachineBasicBlock :: iterator MI , unsigned DestReg , int FrameIndex , const TargetRegisterClass * RC , const TargetRegisterInfo * TRI ) const { DebugLoc DL ; if ( MI != MBB . end ( ) ) DL = MI -> getDebugLoc ( ) ; MachineFunction & MF = * MBB . getParent ( ) ; MachineFrameInfo & MFI = * MF . getFrameInfo ( ) ; MachineMemOperand * MMO = MF . getMachineMemOperand ( MachinePointerInfo :: getFixedStack ( FrameIndex ) , MachineMemOperand :: MOLoad , MFI . getObjectSize ( FrameIndex ) , MFI . getObjectAlignment ( FrameIndex ) ) ; if ( RC == & MD :: GenericRegsRegClass ) { BuildMI ( MBB , MI , DL , get ( MD :: LOADrr ) , DestReg ) . addFrameIndex ( FrameIndex ) . addImm ( 0 ) . addMemOperand ( MMO ) ; } else { llvm_unreachable ( " " ) ; } }
loadRegFromStackSlot - Load the specified register of the given register
class from the specified stack frame index.
loadRegFromStackSlot - Load the specified register of the given register class from the specified stack frame index .