[WebAssembly] Minor code simplification. NFC.
authorDan Gohman <dan433584@gmail.com>
Sat, 14 Nov 2015 23:28:15 +0000 (23:28 +0000)
committerDan Gohman <dan433584@gmail.com>
Sat, 14 Nov 2015 23:28:15 +0000 (23:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253150 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/WebAssembly/WebAssemblyISelLowering.cpp

index 85a123bdc56f8a2c8fd874a3d355367fde8ccc07..47eea934b8cd759f80dd89864488a22c3787d5e5 100644 (file)
@@ -369,7 +369,6 @@ SDValue WebAssemblyTargetLowering::LowerFormalArguments(
   if (IsVarArg)
     fail(DL, DAG, "WebAssembly doesn't support varargs yet");
 
-  unsigned ArgNo = 0;
   for (const ISD::InputArg &In : Ins) {
     if (In.Flags.isByVal())
       fail(DL, DAG, "WebAssembly hasn't implemented byval arguments");
@@ -385,12 +384,11 @@ SDValue WebAssemblyTargetLowering::LowerFormalArguments(
     InVals.push_back(
         In.Used
             ? DAG.getNode(WebAssemblyISD::ARGUMENT, DL, In.VT,
-                          DAG.getTargetConstant(ArgNo, DL, MVT::i32))
+                          DAG.getTargetConstant(InVals.size(), DL, MVT::i32))
             : DAG.getNode(ISD::UNDEF, DL, In.VT));
 
     // Record the number and types of arguments.
     MF.getInfo<WebAssemblyFunctionInfo>()->addParam(In.VT);
-    ++ArgNo;
   }
 
   return Chain;