diff --git a/docs/LangRef.html b/docs/LangRef.html index fc586ed9c39..df5cd9f9af2 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -2041,26 +2041,43 @@ value argument, otherwise it returns the second value argument. -
'call' -Instruction
+
+ 'call' Instruction +
+
+
Syntax:
-
  <result> = call <ty>* <fnptrval>(<param list>)
+
+  <result> = [tail] call <ty>* <fnptrval>(<param list>)
+
+
Overview:
+

The 'call' instruction represents a simple function call.

+
Arguments:
+

This instruction requires several arguments:

+
  1. -

    'ty': shall be the signature of the pointer to function -value being invoked. The argument types must match the types implied -by this signature.

    +

    The "tail" marker indicates whether the callee function accesses any + allocas or varargs in the caller. If the "tail" marker is present, the + function call is eligible for tail call optimization. Note that calls may + be marked "tail" even if they do not occur before a ret instruction.

  2. -

    'fnptrval': An LLVM value containing a pointer to a -function to be invoked. In most cases, this is a direct function -invocation, but indirect calls are just as possible, -calling an arbitrary pointer to function values.

    +

    'ty': shall be the signature of the pointer to function value + being invoked. The argument types must match the types implied by this + signature.

    +
  3. +
  4. +

    'fnptrval': An LLVM value containing a pointer to a function to + be invoked. In most cases, this is a direct function invocation, but + indirect calls are just as possible, calling an arbitrary pointer + to function values.

  5. 'function args': argument list whose types match the @@ -2070,7 +2087,9 @@ calling an arbitrary pointer to function values.

    arguments can be specified.

+
Semantics:
+

The 'call' instruction is used to cause control flow to transfer to a specified function, with its incoming arguments bound to the specified values. Upon a 'ret' @@ -2078,8 +2097,15 @@ instruction in the called function, control flow continues with the instruction after the function call, and the return value of the function is bound to the result argument. This is a simpler case of the invoke instruction.

+
Example:
-
  %retval = call int %test(int %argc)
call int(sbyte*, ...) *%printf(sbyte* %msg, int 12, sbyte 42);
+ +
+  %retval = call int %test(int %argc)
+  call int(sbyte*, ...) *%printf(sbyte* %msg, int 12, sbyte 42);
+  %X = tail call int %foo()
+
+