Change LLI's internal representation of va_list to a pointer to the next
argument to be returned by va_arg. This allows va_lists to be passed
between different LLVM procedures (though it is unlikely that an LLI
va_list would make sense to an external function, except by chance.)
llvm-svn: 9965
diff --git a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
index f516f5d..b547e52 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
+++ b/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
@@ -696,9 +696,7 @@
// <va_list> llvm.va_start() - Implement the va_start operation...
GenericValue llvm_va_start(FunctionType *F, const vector<GenericValue> &Args) {
assert(Args.size() == 0);
- GenericValue Val;
- Val.UIntVal = 0; // Start at the first '...' argument...
- return Val;
+ return TheInterpreter->getFirstVarArg();
}
// void llvm.va_end(<va_list> *) - Implement the va_end operation...