This is an archive of the discontinued LLVM Phabricator instance.

[AVR] Don't assert on an undefined operand
ClosedPublic

Authored by aykevl on Feb 4 2020, 5:34 AM.

Details

Summary

Not all operands are correctly disassembled at the moment. This means that some machine instructions won't have all the necessary operands set.

To avoid asserting, print an error instead until the necessary support has been implemented.

Diff Detail

Event Timeline

aykevl created this revision.Feb 4 2020, 5:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2020, 5:34 AM
dylanmckay added inline comments.Feb 4 2020, 9:32 PM
llvm/lib/Target/AVR/MCTargetDesc/AVRInstPrinter.cpp
103

Add a code comment above this, your commit message should do nicely

Not all operands are correctly disassembled at the moment. This means that some machine instructions won't have all the necessary operands set.

To avoid asserting, print an error instead until the necessary support has been implemented.

138

Recommend duplicating the code comment here; the extra verbosity is worth the extra clarity when we come to inevitably remove it.

aykevl updated this revision to Diff 242574.Feb 5 2020, 5:50 AM

Added comments, as requested.

I agree, this makes it clearer why this check is there in the first place.

dylanmckay accepted this revision.Feb 24 2020, 2:31 AM
This revision is now accepted and ready to land.Feb 24 2020, 2:31 AM
This revision was automatically updated to reflect the committed changes.