llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.02k stars 11.57k forks source link

Missing default branch in switch cases. #108479

Open NEWPLAN opened 5 days ago

NEWPLAN commented 5 days ago

Hi, in the code segment(https://github.com/llvm/llvm-project/blob/main/mlir/lib/Conversion/ArmSMEToLLVM/ArmSMEToLLVM.cpp#L127), a default case is missing in switch, making it non-self-consistent.

braw-lee commented 5 days ago

@NEWPLAN added default branches, not sure if this will affect anything but seems like good coding practice

llvmbot commented 5 days ago

@llvm/issue-subscribers-mlir

Author: NEWPLAN (NEWPLAN)

Hi, in the code segment(https://github.com/llvm/llvm-project/blob/main/mlir/lib/Conversion/ArmSMEToLLVM/ArmSMEToLLVM.cpp#L127), a default case is missing in switch, making it non-self-consistent.
braw-lee commented 1 day ago

i think this issue can be closed as all the switch cases are covered as said by banach-space "It's not clear to me whether this follows https://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations. I do remember that we skipped default because most of these switch statements are fully covered. Is there one that isn't?"