minor cleanups

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48448 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2008-03-17 06:57:02 +00:00
parent d183307639
commit e0b1215a92

View File

@ -230,8 +230,7 @@ LowerCALL(SDOperand Op, SelectionDAG &DAG)
unsigned CallingConv = cast<ConstantSDNode>(Op.getOperand(1))->getValue(); unsigned CallingConv = cast<ConstantSDNode>(Op.getOperand(1))->getValue();
// By now, only CallingConv::C implemented // By now, only CallingConv::C implemented
switch (CallingConv) switch (CallingConv) {
{
default: default:
assert(0 && "Unsupported calling convention"); assert(0 && "Unsupported calling convention");
case CallingConv::Fast: case CallingConv::Fast:
@ -248,7 +247,6 @@ SDOperand MipsTargetLowering::
LowerCCCCallTo(SDOperand Op, SelectionDAG &DAG, unsigned CC) LowerCCCCallTo(SDOperand Op, SelectionDAG &DAG, unsigned CC)
{ {
MachineFunction &MF = DAG.getMachineFunction(); MachineFunction &MF = DAG.getMachineFunction();
unsigned StackReg = MF.getTarget().getRegisterInfo()->getFrameRegister(MF);
SDOperand Chain = Op.getOperand(0); SDOperand Chain = Op.getOperand(0);
SDOperand Callee = Op.getOperand(4); SDOperand Callee = Op.getOperand(4);
@ -275,7 +273,6 @@ LowerCCCCallTo(SDOperand Op, SelectionDAG &DAG, unsigned CC)
SmallVector<std::pair<unsigned, SDOperand>, 8> RegsToPass; SmallVector<std::pair<unsigned, SDOperand>, 8> RegsToPass;
SmallVector<SDOperand, 8> MemOpChains; SmallVector<SDOperand, 8> MemOpChains;
SDOperand StackPtr;
int LastStackLoc = 0; int LastStackLoc = 0;
// Walk the register/memloc assignments, inserting copies/loads. // Walk the register/memloc assignments, inserting copies/loads.
@ -304,13 +301,11 @@ LowerCCCCallTo(SDOperand Op, SelectionDAG &DAG, unsigned CC)
// RegsToPass vector // RegsToPass vector
if (VA.isRegLoc()) { if (VA.isRegLoc()) {
RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg)); RegsToPass.push_back(std::make_pair(VA.getLocReg(), Arg));
} else { continue;
}
assert(VA.isMemLoc()); assert(VA.isMemLoc());
if (StackPtr.Val == 0)
StackPtr = DAG.getRegister(StackReg, getPointerTy());
// Create the frame index object for this incoming parameter // Create the frame index object for this incoming parameter
// This guarantees that when allocating Local Area the firsts // This guarantees that when allocating Local Area the firsts
// 16 bytes which are alwayes reserved won't be overwritten. // 16 bytes which are alwayes reserved won't be overwritten.
@ -324,7 +319,6 @@ LowerCCCCallTo(SDOperand Op, SelectionDAG &DAG, unsigned CC)
// parameter value to a stack Location // parameter value to a stack Location
MemOpChains.push_back(DAG.getStore(Chain, Arg, PtrOff, NULL, 0)); MemOpChains.push_back(DAG.getStore(Chain, Arg, PtrOff, NULL, 0));
} }
}
// Transform all store nodes into one single node because // Transform all store nodes into one single node because
// all store nodes are independent of each other. // all store nodes are independent of each other.