On Dec 11, 2007, at 3:54 PM, Chris Lattner wrote:

On Dec 11, 2007, at 1:31 AM, Christopher Lamb wrote:
Add information on address space qualifiers for pointer types and
global
declarations to the LangRef.

Nice!

 <div class="doc_code">
 <pre>
[EMAIL PROTECTED] = constant float 1.0 addrspace(5), section "foo", align 4

Is there a comma after 1.0?

Nope. It's not treated like other attributes as it affects the type of the GlobalVariable that's created, rather than modifying it after the fact. Ideally I would have liked it to be between the type name and the initializer value, but the current Assembly parser made this very yucky. The other option would be to support the addrspace attribute on types other than pointers in the Assembly syntax, but discard them in all cases except when declaring a global variable, also yucky.

The key here is that the order of asterisks and addrspace() qualifiers are consistent in the global variable declaration and the type name:

@foo = constant float addrspace(1)* 1.0 addrspace(2)

@foo has a type of

float addrspace(1)* addrspace(2)*

--
Christopher Lamb



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to