[llvm-commits] [llvm] r159203 - in /llvm/trunk: lib/Target/ARM/ARMAsmPrinter.cpp lib/Target/CellSPU/SPUAsmPrinter.cpp lib/Target/Hexagon/HexagonAsmPrinter.cpp lib/Target/MBlaze/MBlazeAsmPrinter.cpp lib/Target/NVPTX/NVPTXAsmPrinter.cpp lib/Target/Po...

Aaron Ballman aaron at aaronballman.com
Mon Jul 15 12:00:23 PDT 2013


On Mon, Jul 15, 2013 at 2:52 PM, Jack Carter <Jack.Carter at imgtec.com> wrote:
> Aaron,
>
> Thanks for catching the omission of the call to the generic AsmPrinter::PrintAsmOperand(). Better late than never.
>
> What I don't understand is why a switch statement with only the default filled bad? It is a template for future additions and any compiler worth it's salt will compile it away.

It's not incorrect code, and you are right about optimizing it away.
However, it can catch bugs-by-omission.  Some compilers (such as MSVC)
warn about switch statements with no cases, and we currently suppress
such warnings in our cmake file -- but these are the only two places
where it happens.  Once I've eliminated these two cases, I am hoping
to stop suppressing that warning.  If someone were to want to add
cases, it's trivial to add the switch back in.

~Aaron



More information about the llvm-commits mailing list