[PATCH] D156735: Do not let Value::stripPointerCasts() look through returned arg functions.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 31 14:00:38 PDT 2023


nikic added a comment.

> We can allow this in alias analysis context, but it should be avoided for the general case where looking through would cause a semantic difference, i.e. in an objc_retain call (which will soon be marked thisreturn [1]). FWIW, the "bug" here was introduced in [2].

`returned` is not supposed to have any semantic difference. In fact, we will replace calls with the `returned` attribute with the corresponding argument.

I think this change may still make sense because looking through `returned` in various analyses is pretty useless, because we can just wait for the call result to be replaced with the argument. But I don't think the current behavior should be a correctness issue.


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

https://reviews.llvm.org/D156735



More information about the llvm-commits mailing list