[PATCH] [RFC] Deprecated feature in TableGen

Jim Grosbach grosbach at apple.com
Thu Aug 29 16:15:15 PDT 2013


On Aug 28, 2013, at 4:28 PM, Joey Gouly <joey.gouly at arm.com> wrote:

> 
>> Hi Joey,
>> 
>> With the multiple patches, I’m not completely clear on the state of things, so apologies if this is
> 
>  This is just me coding in the open, trying to get a good of how to approach this. I haven't spent a long time on these patches. I just found it easier to show in code.

Yep, makes total sense. Thanks!

> 
> 
>> I love the idea of being able to mark instructions (and aliases) as deprecated, but I’m not sure the mechanism of a custom comment handler is the right way to do it. We really want an assembler-time warning diagnostic when a deprecated instruction is used, for example. AFAICT, this implementation doesn’t support that and is tailored mainly for the disassembler use case, which quite honestly is much less interesting, IMO.
> 
>  The CustomComment approach was my second approach in trying to be more general (see the first approach as the first diff on this phabricator review)
> 
>> That is, I’d like something more completely TableGen’erated rather than the hard-coded isDeprecated() function in the target’s asmparser class.
> 
>  So something generated into 'ARMGenAsmMatcher.inc' for example?
> 
>  Thanks for the comments, I hope we can push this forward!
> 

Something in the asm matcher seems reasonable for what I’m looking for out of this, yes. If you want to also pursue having the disassembler annotate deprecated instructions, there would be something else necessary, too.

The use case I’m keen on supporting is being able to mark instruction aliases as deprecated so that we can add them when needed for back compatibility, but also tell users up front that they really should modernize their code. Eventually, I’d love to have fixit style hints for how to do that, but thats future stuff. For now, just telling them that it’s deprecated at all would be a huge step forward.

-Jim

> http://llvm-reviews.chandlerc.com/D1399





More information about the llvm-commits mailing list