aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/Interpreter/Execution.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-18 05:55:25 +0000
committerChris Lattner <sabre@nondot.org>2003-10-18 05:55:25 +0000
commit4c6654963dfa4b91c702a913f3715c4a207472d2 (patch)
tree3f363fc907f145e6246db39625a054c224e12526 /lib/ExecutionEngine/Interpreter/Execution.cpp
parenteff112c6c3d018ac97522618e71c8c0956c451ee (diff)
Interpret the new varargs intrinsics correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9222 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/Execution.cpp')
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 7d9d727e76..69e746d159 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -845,27 +845,17 @@ void Interpreter::visitCastInst(CastInst &I) {
SetValue(&I, executeCastOperation(I.getOperand(0), I.getType(), SF), SF);
}
-void Interpreter::visitVarArgInst(VarArgInst &I) {
+void Interpreter::visitVANextInst(VANextInst &I) {
ExecutionContext &SF = ECStack.back();
- // Get the pointer to the valist element. LLI treats the valist in memory as
- // an integer.
- GenericValue VAListPtr = getOperandValue(I.getOperand(0), SF);
-
- // Load the pointer
- GenericValue VAList =
- TheEE->LoadValueFromMemory((GenericValue *)GVTOP(VAListPtr), Type::UIntTy);
-
+ // Get the incoming valist element. LLI treats the valist as an integer.
+ GenericValue VAList = getOperandValue(I.getOperand(0), SF);
+
+ // Move to the next operand.
unsigned Argument = VAList.IntVal++;
-
- // Update the valist to point to the next argument...
- TheEE->StoreValueToMemory(VAList, (GenericValue *)GVTOP(VAListPtr),
- Type::UIntTy);
-
- // Set the value...
assert(Argument < SF.VarArgs.size() &&
"Accessing past the last vararg argument!");
- SetValue(&I, SF.VarArgs[Argument], SF);
+ SetValue(&I, VAList, SF);
}
//===----------------------------------------------------------------------===//