[PATCH] D96832: [Clang][Attributes] Allow not_tail_called attribute to be applied to virtual function.

Zequan Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 17 13:06:41 PST 2021


zequanwu added a comment.

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

> It was explicitly disallowed in the initial patch: https://reviews.llvm.org/D12922 and the original author said "I'm still trying to figure out the best way to handle c++ virtual functions: this attribute is not very useful for someone who is looking for a way to reliably prevent tail-call to a virtual function." and "I made this change because this attribute isn't useful when the compiler cannot resolve the function call statically at compile time and it isn't important for the use case I have." Has this situation changed in the backend?

Oh, I didn't see that. But when I tested `not_tail_called` on normal functions,  it seems like not working(https://godbolt.org/z/znr5b5, `f1` is marked as `not_tail_called`, it still get inlined). Or, I misunderstand how to use it properly?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96832



More information about the cfe-commits mailing list