[PATCH] D146595: [clang] Add clang trampoline_mangled_target attribute

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 27 11:57:11 PDT 2023


dblaikie added a comment.

In D146595#4225132 <https://reviews.llvm.org/D146595#4225132>, @aprantl wrote:

> In D146595#4225048 <https://reviews.llvm.org/D146595#4225048>, @dblaikie wrote:
>
>> I know this is a bit of a redirection/scope creep/etc - but I'd quite like to see a solution that is likely to be usable for the "std::function" problem (stepping into std::function should allow you to reach the underlying function - but lldb currently skips any call to a std-namespaced function, I think, so you step right over the whole op() call) that could also cover the Swift needs. Though perhaps they're just sufficiently different problems that there is no generalizing here.
>
> This patch aims at exposing an existing LLVM IR & DWARF feature in clang.

Existing LLVM IR feature? *goes to check history* Ah, I see - hadn't realized at least at the IR level this was already implemented. (Anyone got experience with how this works in GCC/GDB then? I guess it was implemented there first/ported to clang with the fortran effort? So that might answer some of the questions about how we should implement it in LLVM and Clang, and about the precedent for behavior of the corner cases?)

> Having a generic solution for the std::function problem is definitely worthwhile investigating, but I'm not sure it needs to prevent supporting the existing mechanism in clang.
>
> I understand that this is nowhere near as flexible as a source-level solution, but in case you weren't aware of this, LLDB implements a custom step through plan for std::function:
>
> https://github.com/llvm/llvm-project/blob/fd059ea7ec044198fd75bb2b3aa30734bcace33e/lldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp#L368

Ah, might've been an overreach/misassumption on my part - I thought we came across this somewhere, but it might've been `std::make_unique` or some other standard library code that didn't have this special casing (can imagine various `emplace` functions, etc, where you might want to step into the ctor too).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146595



More information about the cfe-commits mailing list