On Dec 11, 2007, at 8:34 PM, Chris Lattner wrote:
On Dec 11, 2007, at 5:56 PM, Christopher Lamb wrote:
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)*
That is a very strong argument to me, but it seems to argue even more
strongly for:
@G = constant float addrspace(5) 1.0, section "foo", align 4
Your example above would then be:
@foo = constant float addrspace(1)* addrspace(2) 1.0
which has type:
float addrspace(1)* addrspace(2)*
What do you think? the downside is that this may cause bison to have
issues :)
This is ideally what I wanted, but it would mean seriously mucking
with bison and changing how all CosntVal's are handled. I can give it
a try.
--
Chris
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits