This is an archive of the discontinued LLVM Phabricator instance.

[SimplifyIndVar] Use enum class for ExtendKind. NFC
ClosedPublic

Authored by craig.topper on Jul 13 2022, 10:19 PM.

Details

Summary

I happened to notice a two places where the enum was being pass
directly to the bool IsSigned argument of createExtendInst. This
was functionally ok since SignExtended in the enum has value
of 1, but the code shouldn't rely on that.

Using an enum class prevents the enum from being convertible to bool,
but does make writing the enum values more verbose. Since we now
have to write ExtendKind:: in front of them, I've shortened the
names of ZeroExtended and SignExtended.

Diff Detail

Event Timeline

craig.topper created this revision.Jul 13 2022, 10:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2022, 10:19 PM
craig.topper requested review of this revision.Jul 13 2022, 10:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2022, 10:19 PM
nikic accepted this revision.Jul 14 2022, 12:20 AM

LGTM

This revision is now accepted and ready to land.Jul 14 2022, 12:20 AM
This revision was landed with ongoing or failed builds.Jul 14 2022, 10:06 AM
This revision was automatically updated to reflect the committed changes.