From 950e9f83ea761d7495a92f46c2b0b8ee4c54b896 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Mon, 15 Jan 2007 18:27:39 +0000 Subject: Update documentation for parameter attributes for the syntax change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33238 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'docs') diff --git a/docs/LangRef.html b/docs/LangRef.html index b4dc3f975f..41b1f6d5a3 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -687,27 +687,29 @@ a power of 2.

type so two functions types that differ only by the parameter attributes are different function types.

-

Parameter attributes consist of an at sign (@) followed by either a single - keyword or a comma separate list of keywords enclosed in parentheses. For +

Parameter attributes are simple keywords that follow the type specified. If + multiple parameter attributes are needed, they are space separated. For example:

-    %someFunc = i16 @zext (i8 @(sext) %someParam)
-    %someFunc = i16 @zext (i8 @zext %someParam)
+ %someFunc = i16 (i8 sext %someParam) zext + %someFunc = i16 (i8 zext %someParam) zext

Note that the two function types above are unique because the parameter has - a different attribute (@sext in the first one, @zext in the second).

+ a different attribute (sext in the first one, zext in the second). Also note + that the attribute for the function result (zext) comes immediately after the + argument list.

Currently, only the following parameter attributes are defined:

-
@zext
+
zext
This indicates that the parameter should be zero extended just before a call to this function.
-
@sext
+
sext
This indicates that the parameter should be sign extended just before a call to this function.

The current motivation for parameter attributes is to enable the sign and zero extend information necessary for the C calling convention to be passed - from the front end to LLVM. The @zext and @sext attributes + from the front end to LLVM. The zext and sext attributes are used by the code generator to perform the required extension. However, parameter attributes are an orthogonal feature to calling conventions and may be used for other purposes in the future.

-- cgit v1.2.3