[llvm] [Offload] Add default for HSA agent type to silence warning (PR #145943)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 3 05:04:37 PDT 2025


jhuber6 wrote:

> This has started throwing this warning for me:
> 
> ```c++
> llvm-project/offload/plugins-nextgen/amdgpu/src/rtl.cpp:2594:7: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default]
>  2594 |       default:
>       |       ^
> 1 warning generated.
> ```
> 
> Given that the enum has no underlying type, is the compiler allowed to discard this "default" branch as part of optimisations since the enum isn't allowed to contain invalid values?

This is the unfortunate thing where whether or not this emits a warning depends on how new your HSA is. Since this happens with old HSA and will become less of a problem over time I might just ignore it.

https://github.com/llvm/llvm-project/pull/145943


More information about the llvm-commits mailing list