summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2012-10-27 00:44:39 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2012-10-27 00:44:39 +0000
commit2c07f1f140de53be7f4bb54ebebb3d2e5f21202c (patch)
tree8b9ff287e57decf8e81d5cb0685d9dbc7d755075 /llvm/lib
parentb9d75ca84ba412072fa4b80e5734be0ebc173ac9 (diff)
downloadbcm5719-llvm-2c07f1f140de53be7f4bb54ebebb3d2e5f21202c.tar.gz
bcm5719-llvm-2c07f1f140de53be7f4bb54ebebb3d2e5f21202c.zip
[mips] Make sure FuncArg doesn't advance when OrigArgIndex is the same as in the
previous iteration. llvm-svn: 166850
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Mips/MipsISelLowering.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp
index d4a47b51fab..02674f5d050 100644
--- a/llvm/lib/Target/Mips/MipsISelLowering.cpp
+++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp
@@ -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();
OpenPOWER on IntegriCloud