Define an explicit type for arch specific reference kind and use it in switch statement to make the compiler emit warnings if some case is not cover.
It will help to catch such errors when we add new mach-o reference kind.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
not sure if its common coding practice to use return instead of break in switch statements.
lib/ReaderWriter/MachO/ArchHandler_arm.cpp | ||
---|---|---|
916 | There is an assert at line 911, that takes care of making sure all the kinds are specific to ARM, no ? |
I don't know if this is a common practice but it matches the x86_64 and ARM64 ArchHandlers.
lib/ReaderWriter/MachO/ArchHandler_arm.cpp | ||
---|---|---|
916 | assert are runtime error and are not a replacement for proper compile time warning IMHO. |
lib/ReaderWriter/MachO/ArchHandler_arm.cpp | ||
---|---|---|
916 | Sorry I misread the comment. |
Please wait for Nick's review too.
lib/ReaderWriter/MachO/ArchHandler_arm.cpp | ||
---|---|---|
916 | LGTM. |
There is an assert at line 911, that takes care of making sure all the kinds are specific to ARM, no ?