[llvm-dev] RFC: Absolute or "fixed address" symbols as immediate operands
Rafael EspĂndola via llvm-dev
llvm-dev at lists.llvm.org
Tue Oct 25 13:48:19 PDT 2016
>> In fact, it already works:
>>
>> @foo = alias i64, inttoptr (i64 42 to i64*)
>>
>> produces
>>
>> foo = 42
>>
>> Cheers,
>> Rafael
>
>
> 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.
So, for the declaration, do you expect to know the value? If not just
a declaration to a GlobalVariable should be sufficient.
Otherwise, can you use an available_externally alias?
Since we are talking about the class hierarchy, it is somewhat
annoying that there are function declaration and variable
declarations. At the object level, there is only undefined symbols.
Cheers,
Rafael
More information about the llvm-dev
mailing list