This is an archive of the discontinued LLVM Phabricator instance.

[MC] Use ParseStatus in generated AsmParser methods
ClosedPublic

Authored by barannikov88 on Jul 2 2023, 9:09 AM.

Details

Summary

ParseStatus is slightly more convenient to use due to implicit
conversion from bool, which allows to do something like:

return Error(L, "msg");

when with MatchOperandResultTy it had to be:

Error(L, "msg");
return MatchOperand_ParseFail;

It also has more appropriate name since parse* methods are not only for
parsing operands.

Diff Detail

Event Timeline

barannikov88 created this revision.Jul 2 2023, 9:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 2 2023, 9:09 AM
Herald added a subscriber: kosarev. · View Herald Transcript
barannikov88 requested review of this revision.Jul 2 2023, 9:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 2 2023, 9:09 AM
kosarev accepted this revision.Jul 2 2023, 10:16 AM

LGTM, thanks. (Seems to need a rebase?)

This revision is now accepted and ready to land.Jul 2 2023, 10:16 AM
barannikov88 added a comment.EditedJul 2 2023, 10:22 AM

(Seems to need a rebase?)

No, I reverted the NFC commit that was adding the conversion functions and included it here. Thought it would be better to add the methods with a context.

clang-format

This revision was automatically updated to reflect the committed changes.