[PATCH] D104777: PR50767: clear non-distinct debuginfo for function with nodebug definition after undecorated declaration

Bruno De Fraine via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 23 15:45:42 PDT 2021


brunodefraine added a subscriber: probinson.
brunodefraine added a comment.

In D104777#2836669 <https://reviews.llvm.org/D104777#2836669>, @dblaikie wrote:

> Yeah, all that sounds reasonable to me - @brunodefraine could you look into supporting nodebug in a similar way as @aaron.ballman has described here?

Since the debuginfo for `use()` is slightly affected by the `nodebug` version of `t1()` that follows it, I can see how this back propagation is perhaps dangerous. Checking that `nodebug` is the same on all declarations of a function is a way to prevent this.

But when discussing the PR, @probinson wrote "I'm inclined to think we want this to work" and I can see what he means from the use case where I observed the bug. If you don't want debuginfo for the implementation of `t1()`, it should be fine to annotate just the function definition in an implementation file, not the declaration in a header, since the debuginfo of the implementation is not of the caller's concern. But `nodebug` as it exists **does** affect the debuginfo of callers as well, so I cannot really express that I don't want debuginfo for the implementation of a function and leave its callers unaffected?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104777



More information about the cfe-commits mailing list