[PATCH] D73282: Fix debug-info generation for block invocations so that we set the LinkageName instead of the Name

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 28 11:46:42 PST 2020


dblaikie added inline comments.


================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:3659
     // Use llvm function name.
-    Name = Fn->getName();
+    if (Fn->getName().startswith("___Z"))
+      LinkageName = Fn->getName();
----------------
shafik wrote:
> dblaikie wrote:
> > aprantl wrote:
> > > aprantl wrote:
> > > > Could you please add a comment that Clang Blocks are generated as raw llvm::Functions but do have a mangled name and that is handling this case? Otherwise this would look suspicious.
> > > Should *all* raw LLVM functions have their name as the linkage name? Perhaps a raw LLVM function should only have a linkage name and no human-readable name?
> > Seems plausible to me - do we have any data on other types of functions that hit this codepath? 
> So it was not obvious to me what other cases would this branch so I added an assert and ran `check-clang` and from that I saw four cases that ended up here:
> 
> `GenerateCapturedStmtFunction`
> `GenerateOpenMPCapturedStmtFunction`
> `GenerateBlockFunction`
> `generateDestroyHelper`
> 
> It is not obvious to me we want to alter the behavior of any of the other cases.
Could you show any small source examples & their corresponding DWARF & how that DWARF would change? (what names are we using, what names would we end up using/what sort of things are they naming)


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

https://reviews.llvm.org/D73282





More information about the cfe-commits mailing list