From e19d7a702177205053d12305ac44853e8a30b6f4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 27 Sep 2004 21:51:25 +0000 Subject: [PATCH] Patch contributed by Patrick Meredith: added notes on the fact that the current implementation uses sbyte* for va_list. Updated all occurances of valist to va_list (it was inconsistant and find/replace is so easy ;-) ). Added <...> around all occurances of va_list in the intrinsic functions to match the vaarg and vanext instructions and to further show that va_list is a variable type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16530 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 101 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 70 insertions(+), 31 deletions(-) diff --git a/docs/LangRef.html b/docs/LangRef.html index 2c94793c83b..1a2093634f8 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -1762,65 +1762,104 @@ the invoke instruction.

Example:
  %retval = call int %test(int %argc)
call int(sbyte*, ...) *%printf(sbyte* %msg, int 12, sbyte 42);
+ -
'vanext' -Instruction
+
+ 'vanext' Instruction +
+
+
Syntax:
-
  <resultarglist> = vanext <va_list> <arglist>, <argty>
+ +
+  <resultarglist> = vanext <va_list> <arglist>, <argty>
+
+
Overview:
+

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.

+
Arguments:
-

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.

+
Semantics:
-

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

+
Example:
+

See the variable argument processing section.

+
+ -
'vaarg' -Instruction
+
+ 'vaarg' Instruction +
+
+
Syntax:
-
  <resultval> = vaarg <va_list> <arglist>, <argty>
+ +
+  <resultval> = vaarg <va_list> <arglist>, <argty>
+
+
Overview:
-

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.

+
Arguments:
-

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.

+
Semantics:
-

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.

+
Example:
-

See the variable argument processing -section.

+ +

See the variable argument processing section.

+
@@ -1907,7 +1946,7 @@ int %test(int %X, ...) {
Syntax:
-
  call va_list ()* %llvm.va_start()
+
  call <va_list> ()* %llvm.va_start()
Overview:

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.

Syntax:
-
  call void (va_list)* %llvm.va_end(va_list <arglist>)
+
  call void (<va_list>)* %llvm.va_end(<va_list> <arglist>)
Overview:

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.

Syntax:
-  call va_list (va_list)* %llvm.va_copy(va_list <destarglist>)
+  call  <va_list> (<va_list>)* %llvm.va_copy(<va_list> <destarglist>)
 
Overview:
-- 2.34.1