[PATCH] D49542: DwarfDebug: Reduce duplication in addAccel*** methods

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 20 08:29:29 PDT 2018


labath added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2418
+      Holder.getStringPool().getEntry(*Asm, Name);
+  if (Kind == AccelTableKind::Apple)
+    AppleAccel.addName(Ref, Die);
----------------
JDevlieghere wrote:
> I think I slightly prefer a switch here with an unreachable, so we have a NO-OP in case the default hasn't been resolved yet (instead or arbitrarily defaulting to DWARF). 
I've changed this to a switch statement, but I wouldn't recommend relying on llvm_unreachable being a noop (compilers like to turn it into a trap instruction).


Repository:
  rL LLVM

https://reviews.llvm.org/D49542





More information about the llvm-commits mailing list