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

Adrian Prantl via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 27 15:09:15 PDT 2023


aprantl added a subscriber: rnk.
aprantl added a comment.

In D146595#4225630 <https://reviews.llvm.org/D146595#4225630>, @aaron.ballman wrote:

> It's less about other debug formats and more about user experience. My two big concerns are: 1) writing multiple attributes to do the same thing is somewhat user-hostile unless "the same thing" is actually different in some way users will care about, 2) we have a policy that user-facing attributes that do nothing are diagnosed as being ignored, so if we don't support Windows for this attribute, then compiling on that platform is going to generate a pile of "attribute ignored" warnings. If we can support the attribute with PDB as well, that solves both of my big concerns because it makes this attribute generally useful (which is what we aim for with attributes when possible).

That's a valid concern. However, in its current form it would still get lowered into LLVM IR, and LLVM may or may not silently ignore the attribute when lowering to PDB. It could be argued that that's even worse than warning about an ignored attribute. I just wanted to point this out.

> I don't want to sign y'all up for more work you can't easily do yourself, so I don't want to block on support for Windows unless it turns out to be completely trivial to support. But from a review POV, I'd like to hear back from someone who knows something about PDB to validate that the attribute doesn't require a breaking change for support there (like going from taking no args to requiring an arg for some reason, basically). If we don't think breaking changes should be needed, then I think documentation + diagnostics will be sufficient for me.
>
> I did have two questions though:
> What happens when stepping into the attributed function through a function pointer?
> Are there any special situations where a function cannot/should not be marked with the attribute (virtual functions, lambda, blocks)?

@rnk Do you happen to know anything about how PDB handles these?


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