This is an archive of the discontinued LLVM Phabricator instance.

[TableGen][CodeEmitterGen] Avoid empty OpNum switches in getOperandBitOffset()
ClosedPublic

Authored by iii on Jul 20 2023, 2:17 AM.

Details

Summary

getOperandBitOffset() causes the following warning on MSVC:

E:\llvm\ninja\lib\Target\SystemZ\SystemZGenMCCodeEmitter.inc(15414): warning C4060: switch statement contains no 'case' or 'default' labels

Do not emit empty OpNum switches.

Diff Detail

Event Timeline

iii created this revision.Jul 20 2023, 2:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2023, 2:17 AM
iii requested review of this revision.Jul 20 2023, 2:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2023, 2:17 AM

LGTM. As this is fixing a build failure on some platforms, please go ahead and commit.

uweigand accepted this revision.Jul 20 2023, 3:00 AM
This revision is now accepted and ready to land.Jul 20 2023, 3:00 AM
RKSimon requested changes to this revision.Jul 20 2023, 3:08 AM

Sorry, this just replaces the warning with:

warning C4065: switch statement contains 'default' but no 'case' labels

You're going to have to avoid emitting empty cases entirely.

This revision now requires changes to proceed.Jul 20 2023, 3:08 AM
iii updated this revision to Diff 542414.Jul 20 2023, 3:42 AM
  • Avoid emitting empty cases entirely.
iii retitled this revision from [TableGen][CodeEmitterGen] Emit a default label for getOperandBitOffset()'s OpNum switch to [TableGen][CodeEmitterGen] Avoid empty OpNum switches in getOperandBitOffset().Jul 20 2023, 3:43 AM
iii edited the summary of this revision. (Show Details)
RKSimon accepted this revision.Jul 20 2023, 4:26 AM

LGTM - cheers

This revision is now accepted and ready to land.Jul 20 2023, 4:26 AM
This revision was landed with ongoing or failed builds.Jul 20 2023, 4:28 AM
This revision was automatically updated to reflect the committed changes.