[PATCH] D151194: [clang][dataflow] Add support for return values of reference type.

Martin Böhme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 23 02:37:38 PDT 2023


mboehme created this revision.
Herald added subscribers: martong, xazax.hun.
Herald added a reviewer: NoQ.
Herald added a project: All.
mboehme requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This patch changes the way `Environment::ReturnLoc` is set: Whereas previously
it was set by the caller, it is now set by the callee (obviously, as we
otherwise would not be able to return references).

The patch also introduces `Environment::ReturnVal`, which is used for
non-reference-type return values. This allows these to be handled with the
correct value category semantics; see also https://discourse.llvm.org/t/70086,
which describes the ongoing migration to strict value category semantics.

Depends On D150776 <https://reviews.llvm.org/D150776>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151194

Files:
  clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
  clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
  clang/lib/Analysis/FlowSensitive/Transfer.cpp
  clang/unittests/Analysis/FlowSensitive/TransferTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151194.524629.patch
Type: text/x-patch
Size: 19092 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230523/dcd791c9/attachment-0001.bin>


More information about the cfe-commits mailing list