[LLVMdev] .thumb_set
Pete Cooper
peter_cooper at apple.com
Fri Jun 12 11:22:29 PDT 2015
> On Jun 12, 2015, at 11:12 AM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:
>
>> You will yeah. beta had its ‘Offset’ set to some value but then the .set tried to make it a variable using setVariableValue.
>>
>> Given that I put Offset and Value in the same union, I added an assert to ensure that we can’t change from Offset to Value.
>>
>> Do you think its possible for this change from Offset to Value to happen to a symbol? If so, and if Offset and Value are still mutually exclusive then we just need to support overriding the Offset with a Value.
>
> I think so, that is what .thumb_set is doing, it is replacing a
> regular symbol with a variable.
Ah I see.
So I think it would be ok to do this replacement prior to any calls to MCSymbol::getOffset(). It looks like we don’t call that until we are emitting the object file, i.e., we don’t call it during the AsmParser. So I think you’re right that this will be safe.
I’ll double check all the places which make use of the variable just to ensure that they always override any use of the offset.
>
> For what it is worth, just deleting the asserts gets all tests to pass :-)
Yeah, i was tempted to sneak it in without the asserts ;)
Cheers,
Pete
>
> Cheers,
> Rafael
More information about the llvm-dev
mailing list