[PATCH] D155342: [clang][JumpDiagnostics] ignore non-asm goto target scopes

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 18 10:59:10 PDT 2023


nickdesaulniers added inline comments.


================
Comment at: clang/lib/Sema/JumpDiagnostics.cpp:658
 
+    if (auto *G = dyn_cast<GCCAsmStmt>(Jump)) {
+      for (AddrLabelExpr *L : G->labels()) {
----------------
rjmccall wrote:
> I think it would be good to leave a comment here like this:
> 
> > We know the possible destinations of an asm goto, but we don't have the
> > ability to add code along those control flow edges, so we have to diagnose
> > jumps both in and out of scopes, just like we do with an indirect goto.
Depending on your definition of "we" (clang vs. llvm), llvm does have the ability to add code along those edges.

See llvm/lib/CodeGen/CallBrPrepare.cpp.  I'll clarify in your comment that "clang does not split critical edges during code generation of llvm ... "


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155342



More information about the cfe-commits mailing list