This is an archive of the discontinued LLVM Phabricator instance.

[M68k] Fix printing of immediate in `M68kOperand::print`
ClosedPublic

Authored by ids1024 on Apr 13 2023, 10:23 PM.

Details

Summary

The Imm union variant wasn't initialized anywhere. This fixes what is printed by llvm-mc -arch m68k --show-inst-operands.

Diff Detail

Event Timeline

ids1024 created this revision.Apr 13 2023, 10:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2023, 10:23 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
ids1024 requested review of this revision.Apr 13 2023, 10:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2023, 10:23 PM
myhsu added a comment.Apr 15 2023, 2:19 PM

Thanks for spotting this issue. Could you add a (regression) test? Normally people just used the code that triggered the issue.

llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp
1071

curly braces are required for this case since there is a variable declaration within.

ids1024 updated this revision to Diff 514045.Apr 16 2023, 12:56 PM

Regression test and curly braces.

myhsu accepted this revision.Apr 16 2023, 2:31 PM

LGTM Thanks!

This revision is now accepted and ready to land.Apr 16 2023, 2:31 PM
This revision was automatically updated to reflect the committed changes.