This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] Move OperandMatchResultTy enum to MCTargetAsmParser.h
ClosedPublic

Authored by asb on Aug 15 2016, 1:46 AM.

Details

Summary

As it stands, the OperandMatchResultTy is only included in the generated header if there is custom operand parsing. However, almost all backends make use of MatchOperand_Success and friends from OperandMatchResultTy for e.g. parseRegister. This is a pain when starting an AsmParser for a new backend that doesn't yet have custom operand parsing. Move the enum to MCTargetAsmParser.h.

This patch is a prerequisite for D23563

Diff Detail

Event Timeline

asb updated this revision to Diff 68003.Aug 15 2016, 1:46 AM
asb retitled this revision from to [TableGen] Make AsmMatcherEmitter unconditionally expose OperandMatchResultTy enum.
asb updated this object.
asb added reviewers: stoklund, craig.topper.
asb added a subscriber: llvm-commits.

I'd suggest that it be moved into class MCTargetAsmParser in include/llvm/MC/MCParser/MCTargetAsmParser.h, as that's the superclass of the types which currently have it via this tablegen'd code.

asb updated this revision to Diff 74040.Oct 8 2016, 11:56 AM
asb retitled this revision from [TableGen] Make AsmMatcherEmitter unconditionally expose OperandMatchResultTy enum to [TableGen] Move OperandMatchResultTy enum to MCTargetAsmParser.h.
asb updated this object.
asb added a reviewer: grosbach.

Rather than the hacky previous approach (unconditionally emittingthe enum), move it to a header.

asb updated this revision to Diff 74046.Oct 8 2016, 1:20 PM

The last update of this patch was incomplete. Now fixed.

asb updated this object.Oct 8 2016, 1:22 PM
asb edited edge metadata.
jyknight accepted this revision.Oct 11 2016, 6:11 AM
jyknight edited edge metadata.
This revision is now accepted and ready to land.Oct 11 2016, 6:11 AM
This revision was automatically updated to reflect the committed changes.