[llvm-commits] [llvm] r44860 - /llvm/trunk/docs/LangRef.html
Christopher Lamb
christopher.lamb at gmail.com
Tue Dec 11 17:56:30 PST 2007
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>
>> + at G = 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20071211/7e071947/attachment.html>
More information about the llvm-commits
mailing list