This is an archive of the discontinued LLVM Phabricator instance.

[AsmMatcher] Extend PredicateMethod with optional DiagnosticPredicate
ClosedPublic

Authored by sdesmalen on Apr 20 2018, 6:33 AM.

Details

Summary

An optional, light-weight and backward-compatible mechanism to allow
specifying that a diagnostic _only_ applies to a partial mismatch (NearMiss),
rather than a full mismatch.

Patch [1/2] in a series to improve assembler diagnostics for SVE.

Diff Detail

Repository
rL LLVM

Event Timeline

sdesmalen created this revision.Apr 20 2018, 6:33 AM

Can't remember if it was @olista01 or @SjoerdMeijer who was doing the partial match in the assembler, but the idea sounds good to me. I'll let them (or someone else closer to the changes) to approve.

fhahn added a subscriber: asb.Apr 24 2018, 1:40 AM

IMO this leads to a nice improvement for the assembler diagnostics as shown D45880. I think it would be great if we could also make the recent improvements to usability more visible, so they can get wider usage across backends.

include/llvm/MC/MCParser/MCTargetAsmParser.h
136 ↗(On Diff #143305)

enum class ?

Looks good to me too, just some comments about typos/nits inlined from my side. I will let Oliver approve as he did most of the work in this area.

include/llvm/MC/MCParser/MCTargetAsmParser.h
142 ↗(On Diff #143305)

nit: try -> try to

143 ↗(On Diff #143305)

nit: that operand -> that the operand

161 ↗(On Diff #143305)

typo: diagnostice

sdesmalen updated this revision to Diff 143700.Apr 24 2018, 3:14 AM
  • Changed DiagnosticPredicateTy from 'enum' to 'enum class'.
  • Made the constructor for 'DiagnosticPredicate(bool) explicit'.
  • Fixed typos.
sdesmalen marked 4 inline comments as done.Apr 24 2018, 3:16 AM
SjoerdMeijer added inline comments.Apr 24 2018, 3:55 AM
include/llvm/MC/MCParser/MCTargetAsmParser.h
158 ↗(On Diff #143700)

Sorry, one more nit while we wait for Oliver's lgtm: is "decoration suffix" the right terminology here? Should this e.g. be "access suffix", or something else?

sdesmalen added inline comments.Apr 24 2018, 5:43 AM
include/llvm/MC/MCParser/MCTargetAsmParser.h
158 ↗(On Diff #143700)

Agreed, 'decoration suffix' may not be the right terminology, although I'm not sure if 'access suffix' is much clearer. How about just using 'shift/extend' ?

SjoerdMeijer added inline comments.Apr 25 2018, 12:12 AM
include/llvm/MC/MCParser/MCTargetAsmParser.h
158 ↗(On Diff #143700)

Agreed, that looks better.

This revision is now accepted and ready to land.Apr 25 2018, 7:58 AM
This revision was automatically updated to reflect the committed changes.