[mips] Make sure FuncArg doesn't advance when OrigArgIndex is the same as in the

previous iteration.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166850 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Akira Hatanaka 2012-10-27 00:44:39 +00:00
parent fe30a9be40
commit 4618e0b574
2 changed files with 14 additions and 1 deletions

View File

@ -2983,10 +2983,13 @@ MipsTargetLowering::LowerFormalArguments(SDValue Chain,
Function::const_arg_iterator FuncArg =
DAG.getMachineFunction().getFunction()->arg_begin();
unsigned CurArgIdx = 0;
MipsCC::byval_iterator ByValArg = MipsCCInfo.byval_begin();
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i, ++FuncArg) {
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
CCValAssign &VA = ArgLocs[i];
std::advance(FuncArg, Ins[i].OrigArgIndex - CurArgIdx);
CurArgIdx = Ins[i].OrigArgIndex;
EVT ValVT = VA.getValVT();
ISD::ArgFlagsTy Flags = Ins[i].Flags;
bool IsRegLoc = VA.isRegLoc();

View File

@ -119,6 +119,16 @@ entry:
ret void
}
%struct.S4 = type { [4 x i32] }
define void @f5(i64 %a0, %struct.S4* nocapture byval %a1) nounwind {
entry:
tail call void @f6(%struct.S4* byval %a1, i64 %a0) nounwind
ret void
}
declare void @f6(%struct.S4* nocapture byval, i64)
!0 = metadata !{metadata !"int", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA", null}