This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Use table-gen'd assembly operand diags in ARM asm parser
ClosedPublic

Authored by olista01 on Apr 3 2017, 10:00 AM.

Details

Summary

This switches the ARM AsmParser to use assembly operand diagnostics from
tablegen, rather than a switch statement on the ARMMatchResultTy. It
moves the existing diagnostic strings to tablegen, but adds no new ones,
so this is NFC except for one diagnostic string that had an off-by-1 error
in the hand-written switch statement.

Diff Detail

Repository
rL LLVM

Event Timeline

olista01 created this revision.Apr 3 2017, 10:00 AM
rengolin accepted this revision.Apr 4 2017, 8:03 AM

Oh, this is *much* better, thanks!

This revision is now accepted and ready to land.Apr 4 2017, 8:03 AM
rengolin added inline comments.
lib/Target/ARM/AsmParser/ARMAsmParser.cpp
10089

Quick question: why is the switch still here if the only case is the default?

olista01 added inline comments.Apr 4 2017, 9:23 AM
lib/Target/ARM/AsmParser/ARMAsmParser.cpp
10089

This will be used once we have operands that need diags that differ depending on subtarget features. Most of these on ARM are register classes, which we can't currently emit diagnostics for, but I have a prototype that allows that.

rengolin added inline comments.Apr 4 2017, 10:53 AM
lib/Target/ARM/AsmParser/ARMAsmParser.cpp
10089

Right. Maybe we should just remove this for now, and add it back when you add the new code.

olista01 updated this revision to Diff 94654.Apr 10 2017, 2:12 AM

Remove getCustomOperandDiag until it's actually needed.

This is dependent on D31530, so I'll commit it once that one is committed.

This revision was automatically updated to reflect the committed changes.