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

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 15:06:18 PST 2020


dblaikie added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp:754
+    switch (Op.getKind()) {
+    default:
+      llvm_unreachable("unknown SDDbgOperand kind");
----------------
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.




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