<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Oct 25, 2016 at 5:49 AM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">>>> @foo = globalconst i32 42<br>
>>><br>
>>><br>
>>> This is equivalent to writing "foo = 42" in assembly?<br>
>><br>
>><br>
>> Yes.<br>
><br>
><br>
> Back in the day the idea was to use an alias whose ConstantExpr was<br>
> just 42. Would that work?<br>
<br>
</span>In fact, it already works:<br>
<br>
@foo = alias i64, inttoptr (i64 42 to i64*)<br>
<br>
produces<br>
<br>
foo = 42<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br>Right, I should have brought up that we can already use aliases for definitions -- that's what I've been using in my prototype. What I think we need to decide on here is a representation for declarations. From that, I think our representation for definitions should be clear. For example, I think that if we decide to require GlobalConstant to have a pointer type, it may be reasonable to use it only for declarations and to use GlobalAlias for definitions. This I think would be analogous to the current state where a GlobalAlias can be referenced by either a Function or a GlobalVariable.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks,<br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">-- <div>Peter</div></div></div>
</div></div>