This is an archive of the discontinued LLVM Phabricator instance.

[InlineAsm] wrap Kind in enum class NFC
ClosedPublic

Authored by nickdesaulniers on Aug 30 2023, 5:03 PM.

Details

Summary

Should add some minor type safety to the use of this information, since
there's quite a bit of metadata being laundered through an unsigned.

I'm looking to potentially add more bitfields to that unsigned, but I
find InlineAsm's big ol' bag of enum values and usage of unsigned
confusing, type-unsafe, and un-ergonomic. These can probably be better
abstracted.

I think the lack of static_cast outside of InlineAsm indicates the prior
code smell fixed here.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2023, 5:03 PM
nickdesaulniers requested review of this revision.Aug 30 2023, 5:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2023, 5:03 PM
nickdesaulniers edited subscribers, added: nathanchance; removed: jyknight.Aug 30 2023, 5:16 PM
qcolombet accepted this revision.Aug 31 2023, 5:38 AM

Nice clean-up!

This revision is now accepted and ready to land.Aug 31 2023, 5:38 AM
This revision was landed with ongoing or failed builds.Aug 31 2023, 8:55 AM
This revision was automatically updated to reflect the committed changes.