From e19d7a702177205053d12305ac44853e8a30b6f4 Mon Sep 17 00:00:00 2001
From: Chris Lattner
%retval = call int %test(int %argc)+ - + +
call int(sbyte*, ...) *%printf(sbyte* %msg, int 12, sbyte 42);
<resultarglist> = vanext <va_list> <arglist>, <argty>+ +
+ <resultarglist> = vanext <va_list> <arglist>, <argty> ++
The 'vanext' instruction is used to access arguments passed through the "variable argument" area of a function call. It is used to implement the va_arg macro in C.
+This instruction takes a valist value and the type of the -argument. It returns another valist.
+ +This instruction takes a va_list value and the type of the +argument. It returns another va_list. The actual type of +va_list may be defined differently for different targets. Most targets +use a va_list type of sbyte* or some other pointer type.
+The 'vanext' instruction advances the specified valist + +
The 'vanext' instruction advances the specified va_list past an argument of the specified type. In conjunction with the vaarg instruction, it is used to implement the va_arg macro available in C. For more information, see the variable argument handling Intrinsic Functions.
+It is legal for this instruction to be called in a function which does not take a variable number of arguments, for example, the vfprintf function.
+vanext is an LLVM instruction instead of an intrinsic function because it takes an type as -an argument.
+href="#intrinsics">intrinsic function because it takes a type as an +argument. The type refers to the current argument in the va_list, it +tells the compiler how far on the stack it needs to advance to find the next +argument +See the variable argument processing section.
+<resultval> = vaarg <va_list> <arglist>, <argty>+ +
+ <resultval> = vaarg <va_list> <arglist>, <argty> ++
The 'vaarg' instruction is used to access arguments passed -through the "variable argument" area of a function call. It is used to -implement the va_arg macro in C.
+ +The 'vaarg' instruction is used to access arguments passed through +the "variable argument" area of a function call. It is used to implement the +va_arg macro in C.
+This instruction takes a valist value and the type of the -argument. It returns a value of the specified argument type.
+ +This instruction takes a va_list value and the type of the +argument. It returns a value of the specified argument type. Again, the actual +type of va_list is target specific.
+The 'vaarg' instruction loads an argument of the specified -type from the specified va_list. In conjunction with the vanext instruction, it is used to -implement the va_arg macro available in C. For more -information, see the variable argument handling Intrinsic -Functions.
-It is legal for this instruction to be called in a function which -does not take a variable number of arguments, for example, the vfprintf + +
The 'vaarg' instruction loads an argument of the specified type from +the specified va_list. In conjunction with the vanext instruction, it is used to implement the +va_arg macro available in C. For more information, see the variable +argument handling Intrinsic Functions.
+ +It is legal for this instruction to be called in a function which does not +take a variable number of arguments, for example, the vfprintf function.
+vaarg is an LLVM instruction instead of an intrinsic function because it takes an type as -an argument.
+href="#intrinsics">intrinsic function because it takes an type as an +argument. +See the variable argument processing -section.
+ +See the variable argument processing section.
+call va_list ()* %llvm.va_start()+
call <va_list> ()* %llvm.va_start()
The 'llvm.va_start' intrinsic returns a new <arglist> for subsequent use by the variable argument intrinsics.
@@ -1929,7 +1968,7 @@ within the body of a variable argument function.call void (va_list)* %llvm.va_end(va_list <arglist>)+
call void (<va_list>)* %llvm.va_end(<va_list> <arglist>)
The 'llvm.va_end' intrinsic destroys <arglist> which has been initialized previously with llvm.va_start @@ -1954,7 +1993,7 @@ with calls to llvm.va_end.
- call va_list (va_list)* %llvm.va_copy(va_list <destarglist>) + call <va_list> (<va_list>)* %llvm.va_copy(<va_list> <destarglist>)