Skip to content

[DirectX] Clean up to_underlying in case labels #150676

@llvm-beanz

Description

@llvm-beanz

A bunch of switch statements have been added in the DirectX backend that operate over enums, but the input type is an integer instead of an enum. The switches are written with llvm::to_underlying as the case labels.

This pattern prevents switch-based compiler warnings to ensure that switch statements cover all appropriate cases. We should instead rewrite these switch statements to convert the integer to enumeration values (handling out-of-range possibility before the switch), then have the switch operate on the enum values themselves.

This pattern exists at the moment in:

  • RootSignatureValidations.cpp
  • DXContainerRootSignature.cpp
  • DXContainerEmitter.cpp
  • DXContainerYAML.cpp
  • DXILRootSignature.cpp

Metadata

Metadata

Assignees

Type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions