Page MenuHomePhabricator

ARMDefines.h: fix -Wimplicit-fallthrough in -DLLVM_ENABLE_ASSERTIONS=OFF builds
ClosedPublic

Authored by MaskRay on May 12 2019, 11:19 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

MaskRay created this revision.May 12 2019, 11:19 PM

I've seen these warnings for a very long time...

[677/732] Building CXX object tools/lldb/source/API/CMakeFiles/liblldb.dir/SystemInitializerFull.cpp.o          
In file included from ../tools/lldb/source/API/SystemInitializerFull.cpp:46:                                   
In file included from ../tools/lldb/source/./Plugins/Instruction/ARM/EmulateInstructionARM.h:12:               
../tools/lldb/source/./Plugins/Process/Utility/ARMDefines.h:73:3: warning: unannotated fall-through between swit
ch labels [-Wimplicit-fallthrough]
  case COND_EQ:
  ^
../tools/lldb/source/./Plugins/Process/Utility/ARMDefines.h:73:3: note: insert 'LLVM_FALLTHROUGH;' to silence th
is warning
  case COND_EQ:
  ^
  LLVM_FALLTHROUGH; 
../tools/lldb/source/./Plugins/Process/Utility/ARMDefines.h:73:3: note: insert 'break;' to avoid fall-through  
  case COND_EQ:
  ^
  break; 
1 warning generated.
[732/732] Linking CXX executable bin/lldb
rovka added a subscriber: rovka.May 13 2019, 1:16 AM

Why not remove the default clause and put the unreachable after the switch?

Why not remove the default clause and put the unreachable after the switch?

+1

MaskRay updated this revision to Diff 199359.May 13 2019, 7:38 PM

Move llvm_unreachable after the switch

This revision is now accepted and ready to land.May 13 2019, 7:40 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2019, 9:09 PM