core changes for varargs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22254 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 11608b6bf..a41d12a 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -988,18 +988,6 @@
   SetValue(&I, executeCastOperation(I.getOperand(0), I.getType(), SF), SF);
 }
 
-void Interpreter::visitVANextInst(VANextInst &I) {
-  ExecutionContext &SF = ECStack.back();
-
-  // Get the incoming valist parameter.  LLI treats the valist as a
-  // (ec-stack-depth var-arg-index) pair.
-  GenericValue VAList = getOperandValue(I.getOperand(0), SF);
-
-  // Move the pointer to the next vararg.
-  ++VAList.UIntPairVal.second;
-  SetValue(&I, VAList, SF);
-}
-
 #define IMPLEMENT_VAARG(TY) \
    case Type::TY##TyID: Dest.TY##Val = Src.TY##Val; break
 
@@ -1033,6 +1021,9 @@
 
   // Set the Value of this Instruction.
   SetValue(&I, Dest, SF);
+
+  // Move the pointer to the next vararg.
+  ++VAList.UIntPairVal.second;
 }
 
 //===----------------------------------------------------------------------===//