[PATCH] D88592: [DebugInfo] Emit DBG_VALUE_LIST from ISel

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 11 18:37:16 PST 2020


aprantl added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp:754
+    switch (Op.getKind()) {
+    default:
+      llvm_unreachable("unknown SDDbgOperand kind");
----------------
dblaikie wrote:
> aprantl wrote:
> > Is there a way to assert while still getting the benefit of Clang's switch-doesnt-cover-all-enum-cases warning here?
> Roughly speaking: Not really, no.
> 
> If you have a fully covered switch, you'll get a warning if you have a default (-Wcovered-switch-default). Generally unless you're reading from user input, you shouldn't worry too much about having invalid enum values - at least most of LLVM doesn't try to have defensive asserts for these sort of spoiled enum values.
> 
> 
Thanks for clarifying — I guess the subtext here is that we could just remove the assertion and rely on the compiler warning instead, right?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88592



More information about the llvm-commits mailing list