From: Christopher Lamb Date: Tue, 11 Dec 2007 09:31:00 +0000 (+0000) Subject: Add information on address space qualifiers for pointer types and global X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=284d992777d6364962037eb71082547507275765;p=oota-llvm.git Add information on address space qualifiers for pointer types and global declarations to the LangRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44860 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/LangRef.html b/docs/LangRef.html index 5d20a76fdfe..fd40c92f9aa 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -668,6 +668,11 @@ variables always define a pointer to their "content" type because they describe a region of memory, and all memory objects in LLVM are accessed through pointers.

+

A global variable may be declared to reside in a target-specifc numbered +address space. For targets that support them, address spaces may affect how +optimizations are performed and/or what target instructions are used to access +the variable. The default address space is zero.

+

LLVM allows an explicit section to be specified for globals. If the target supports it, it will emit globals to the section specified.

@@ -677,12 +682,12 @@ to whatever it feels convenient. If an explicit alignment is specified, the global is forced to have at least that much alignment. All alignments must be a power of 2.

-

For example, the following defines a global with an initializer, section, - and alignment:

+

For example, the following defines a global in a numbered address space with +an initializer, section, and alignment:

-@G = constant float 1.0, section "foo", align 4
+@G = constant float 1.0 addrspace(5), section "foo", align 4
 
@@ -1256,7 +1261,10 @@ instruction.

Overview:

As in many languages, the pointer type represents a pointer or -reference to another object, which must live in memory.

+reference to another object, which must live in memory. Pointer types may have +an optional address space attribute defining the target-specific numbered +address space where the pointed-to object resides. The default address space is +zero.

Syntax:
  <type> *
Examples:
@@ -1265,6 +1273,7 @@ reference to another object, which must live in memory.

[4x i32]*
i32 (i32 *) *
+ i32 addrspace(5)*
A pointer to array of @@ -1272,6 +1281,8 @@ reference to another object, which must live in memory.

A pointer to a function that takes an i32*, returning an i32.
+ A pointer to an i32 value that resides + in address space 5.