[Lldb-commits] [PATCH] D113155: [lldb] Remove nested switches from ARMGetSupportedArchitectureAtIndex (NFC)

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 5 12:24:51 PDT 2022


JDevlieghere marked 3 inline comments as done.
JDevlieghere added inline comments.


================
Comment at: lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp:640
+  }
+  return {};
+}
----------------
fixathon wrote:
> JDevlieghere wrote:
> > fixathon wrote:
> > > Could we delete this unreachable return statement?  It's tripping up static code checkers since all possible branches already have a return.
> > Yes, let's make it an `llvm_unreachable` (otherwise gcc will complain).
> If we return {} in the **default** case, and delete this,  gcc should not complain since all possible code paths will have a return, is that right?
> Alternatively, we could break in the **default** case and leave this return alone. I prefer the first approach for consistency.
Yes, you're right, it's only a problem for gcc when you explicitly handle every case (see all the instances of `llvm_unreachable("Fully covered switch!");` in lldb/llvm). 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113155/new/

https://reviews.llvm.org/D113155



More information about the lldb-commits mailing list