[PATCH] D144181: [clang][DebugInfo] Add abi-tags on constructors/destructors as LLVM annotations

Michael Buch via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 21 01:32:20 PST 2023


Michael137 added a comment.

> The construction of the mangled name does not require getting just the abi tags of the constructor itself right. Rather, it requires knowing the abi tag annotations of all arguments (template and regular) of the constructor, and template arguments of all enclosing classes. Is the information in this patch enough to reconstruct this name (_ZN2S1I1AB4asdfE2S2I1BB4asdfEC2I1CB4asdfEET_1DB4asdf, a.k.a, S1<A[abi:asdf]>::S2<B[abi:asdf]>::S2<C[abi:asdf]>(C[abi:asdf], D[abi:asdf]))?

That's a fair point. I purposefully didn't support abi_tag's on all possible declarations because that would've ballooned the debug-info size too much. And we get away with it because libc++ exclusively tags functions. But of course there's no guarantee that they won't start tagging structures or namespaces

> we could at least solve the first problem fairly easily by making the extra constructor an extension -- either an extra extension DIE, or just an extra attribute (with the other linkage name) on the existing constructor. For the second part, I could imagine some kind of an extension for the asm annotation for constructors, which would allow one to pass two mangled names instead of one. I have no idea how hard would it be to implement it though...

I've thought about doing it that way for a bit too. It does seem like a more consistent approach. What I concluded was that LLDB would have a hard time with this sort of setup. E.g., how would we know which subprogram (and thus which linkage name) to construct the single `CXXConstructorDecl` with?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144181



More information about the cfe-commits mailing list