X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FLangRef.html;h=15ecf86d4f86142bf172c97dd2a2abfe53b3218a;hb=4962e6143186f6168f5d0ee979bf047651a13124;hp=4c635d3a5aadc4951faba7f29599b28db2f37125;hpb=1005bc5068345e28826a32cc081dd4667af978ff;p=oota-llvm.git diff --git a/docs/LangRef.html b/docs/LangRef.html index 4c635d3a5aa..15ecf86d4f8 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -25,6 +25,7 @@
-; Declare the string constant as a global constant. -@.LC0 = internal constant [13 x i8] c"hello world\0A\00" ; [13 x i8]* +; Declare the string constant as a global constant. +@.LC0 = internal constant [13 x i8] c"hello world\0A\00" ; [13 x i8]* -; External declaration of the puts function -declare i32 @puts(i8*) ; i32 (i8*)* +; External declaration of the puts function +declare i32 @puts(i8*) ; i32 (i8*)* ; Definition of main function -define i32 @main() { ; i32()* - ; Convert [13 x i8]* to i8 *... - %cast210 = getelementptr [13 x i8]* @.LC0, i64 0, i64 0 ; i8* +define i32 @main() { ; i32()* + ; Convert [13 x i8]* to i8 *... + %cast210 = getelementptr [13 x i8]* @.LC0, i64 0, i64 0 ; i8* - ; Call puts function to write out the string to stdout. - call i32 @puts(i8* %cast210) ; i32 - ret i32 0
} + ; Call puts function to write out the string to stdout. + call i32 @puts(i8* %cast210) ; i32 + ret i32 0 +} ; Named metadata !1 = metadata !{i32 41} @@ -556,6 +558,15 @@ define i32 @main() { ; i32()* linker. The symbols are removed by the linker from the final linked image (executable or dynamic library). +
You may give a name to any type except - "void". Type name aliases may be used anywhere a type + "void". Type name aliases may be used anywhere a type is expected with the syntax "%mytype".
Note that type names are aliases for the structural type that they indicate, @@ -835,6 +846,13 @@ define i32 @main() { ; i32()* region of memory, and all memory objects in LLVM are accessed through pointers.
+Global variables can be marked with unnamed_addr which indicates + that the address is not significant, only the content. Constants marked + like this can be merged with other constants if they have the same + initializer. Note that a constant with significant address can + be merged with a unnamed_addr constant, the result being a + constant whose address is significant.
+A global variable may be declared to reside in a target-specific numbered address space. For targets that support them, address spaces may affect how optimizations are performed and/or what target instructions are used to @@ -874,7 +892,8 @@ define i32 @main() { ; i32()*
LLVM function definitions consist of the "define" keyword, an optional linkage type, an optional visibility style, an optional - calling convention, a return type, an optional + calling convention, + an optional unnamed_addr attribute, a return type, an optional parameter attribute for the return type, a function name, a (possibly empty) argument list (each with optional parameter attributes), optional @@ -885,7 +904,8 @@ define i32 @main() { ; i32()*
LLVM function declarations consist of the "declare" keyword, an optional linkage type, an optional visibility style, an optional - calling convention, a return type, an optional + calling convention, + an optional unnamed_addr attribute, a return type, an optional parameter attribute for the return type, a function name, a possibly empty list of arguments, an optional alignment, and an optional garbage collector name.
@@ -911,6 +931,9 @@ define i32 @main() { ; i32()* specified, the function is forced to have at least that much alignment. All alignments must be a power of 2. +If the unnamed_addr attribute is given, the address is know to not + be significant and two identical functions can be merged
. +define [linkage] [visibility] @@ -949,15 +972,17 @@ define [linkage] [visibility]@@ -992,13 +1017,15 @@ declare signext i8 @returns_signed_char()Named metadata is a collection of metadata. Metadata - nodes (but not metadata strings) and null are the only valid operands for + nodes (but not metadata strings) are the only valid operands for a named metadata.
Syntax:
-; An unnamed metadata node, which is referenced by the named metadata. +; Some unnamed metadata nodes, which are referenced by the named metadata. +!0 = metadata !{metadata !"zero"} !1 = metadata !{metadata !"one"} +!2 = metadata !{metadata !"two"} ; A named metadata. -!name = !{null, !1} +!name = !{!0, !1, !2}
This indicates that the pointer parameter should really be passed by + value to the function. The attribute implies that a hidden copy of the + pointee is made between the caller and the callee, so the callee is unable to modify the value in the callee. This attribute is only valid on LLVM pointer arguments. It is generally used to pass structs and arrays by @@ -1017,10 +1045,13 @@ declare signext i8 @returns_signed_char() to belong to the caller not the callee (for example, readonly functions should not write to byval parameters). This is not a valid attribute for return - values. The byval attribute also supports specifying an alignment with - the align attribute. This has a target-specific effect on the code - generator that usually indicates a desired alignment for the synthesized - stack slot.
The byval attribute also supports specifying an alignment with + the align attribute. It indicates the alignment of the stack slot to + form and the known alignment of the pointer specified to the call site. If + the alignment is not specified, then the code generator makes a + target-specific assumption.
The x86mmx type represents a value held in an MMX register on an x86 machine. The operations allowed on it are quite limited: parameters and return values, load and store, and bitcast. User-specified MMX instructions are represented as intrinsic or asm calls with arguments and/or results of this type. There are no arrays, vectors or constants of this type.
+ ++ x86mmx ++ +
Aggregate Types are a subset of derived types that can contain multiple member types. Arrays, - structs, vectors and - unions are aggregate types.
+ structs, and vectors are + aggregate types. @@ -1701,9 +1755,7 @@ ClassificationsThe function type can be thought of as a function signature. It consists of a return type and a list of formal parameter types. The return type of a - function type is a scalar type, a void type, a struct type, or a union - type. If the return type is a struct type then all struct elements must be - of first class types, and the struct must have at least one element.
+ function type is a first class type or a void type.@@ -1824,53 +1876,6 @@ Classifications - - - --- -- @@ -1932,8 +1937,9 @@ Classifications < <# elements> x <elementtype> >Overview:
-A union type describes an object with size and alignment suitable for - an object of any one of a given set of types (also known as an "untagged" - union). It is similar in concept and usage to a - struct, except that all members of the union - have an offset of zero. The elements of a union may be any type that has a - size. Unions must have at least one member - empty unions are not allowed. -
- -The size of the union as a whole will be the size of its largest member, - and the alignment requirements of the union as a whole will be the largest - alignment requirement of any member.
- -Union members are accessed using 'load and - 'store' by getting a pointer to a field with - the 'getelementptr' instruction. - Since all members are at offset zero, the getelementptr instruction does - not affect the address, only the type of the resulting pointer.
- -Syntax:
-- union { <type list> } -- -Examples:
--
- -- union { i32, i32*, float } -A union of three types: an i32, a pointer to - an i32, and a float. -- -- union { float, i32 (i32) * } -A union, where the first element is a float and the - second element is a pointer to a - function that takes an i32, returning - an i32. -
The number of elements is a constant integer value; elementtype may be any - integer or floating point type.
+The number of elements is a constant integer value larger than 0; elementtype + may be any integer or floating point type. Vectors of size zero are not + allowed, and pointers are not allowed as the element type.