[LLVMdev] .thumb_set

Pete Cooper peter_cooper at apple.com
Mon Jun 15 11:30:14 PDT 2015


> On Jun 15, 2015, at 3:34 AM, Renato Golin <renato.golin at linaro.org> wrote:
> 
> On 15 June 2015 at 03:21, Pete Cooper <peter_cooper at apple.com> wrote:
>> I would argue that in this case it should throw exactly the same errors in
>> exactly the same situations as .set. Any more/less and it wouldn’t be
>> equivalent.
> 
> Sigh... You are, obviously, correct.
> 
> I hate when GCC/GAS documents something and does another. When you
> bring this to them all you get is "we can't change now because
> legacy”.
Yeah, i hope that doesn’t happen here. but no way to know for sure if this will uncover bad code or not.

I’ve prepared a patch just to see what this would take to get the .set behavior.  I first tried to refactored AsmParser::parseAssignment so that the act of parsing was separate from emitting the assignment. The we can call EmitAssignment in the AsmParser and emitThumbSet in the ARMArmParser.

Unfortunately that doesn’t work due to ARMAsmParser being a MCTargetAsmParser and so unrelated to AsmParser.  Also, AsmParser itself is fully defined in a .cpp file, with no headers shared by anything else.

So, sharing any code here seems complicated.  I could move the parseAssignment stuff down to the MCAsmParser but it feels unrelated to any of the other methods in that class.

Anyway here’s the patch in case you’re curious.  I’ll of course need to add the comments you mentioned and tests, and await feedback about this whole issue from Saleem.

Cheers,
Pete

-------------- next part --------------
A non-text attachment was scrubbed...
Name: thumb_set.patch
Type: application/octet-stream
Size: 3813 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150615/24930990/attachment.obj>
-------------- next part --------------

> 
> In the past, we have chosen being compatible with the docs over
> bug-for-bug, so in this case, I think we better implement .thumb_set
> as .set and add a big comment about this in the code, so that future
> bug reports can be quickly dismissed after a short investigation.
> 
> Saleem, does that sound reasonable?
> 
> cheers,
> --renato



More information about the llvm-dev mailing list