[PATCH] D109940: Fixed bug with clang where a fallthrough switch statement wasn't getting proper debug information

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 16 19:03:46 PDT 2021


aprantl added a comment.

Thanks! I have one question inline.



================
Comment at: clang/lib/CodeGen/CGStmt.cpp:1523
+  // by a default statement.
+  if (CurCase->getSubStmt()->getStmtClass() == Stmt::DefaultStmtClass) {
+    EmitStopPoint(CurCase);
----------------
Is the default statement special in a meaningful way here, or could a more general patch also work for a switch statement like:
```
  switch (num) {
  case 0:
    break;
  case 10: // break here
  case 11:
     break;
  default:
}
```

In other words, should wee just unconditionally emit a stop point?


================
Comment at: clang/test/CodeGen/switch-fallthrough.c:1
+// RUN:  %clang_cc1 -triple x86_64-apple-macosx11.0.0 -debug-info-kind=standalone -emit-llvm %s -o - | FileCheck %s -v
+// CHECK: ], !dbg !{{[0-9]+}}
----------------
Is the -v necessary?


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

https://reviews.llvm.org/D109940



More information about the llvm-commits mailing list