[all-commits] [llvm/llvm-project] 644135: [clang][dataflow] Add support for return values of...

martinboehme via All-commits all-commits at lists.llvm.org
Thu May 25 01:38:50 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 64413584dacba1fccffa345f69043b3509ee1745
      https://github.com/llvm/llvm-project/commit/64413584dacba1fccffa345f69043b3509ee1745
  Author: Martin Braenne <mboehme at google.com>
  Date:   2023-05-25 (Thu, 25 May 2023)

  Changed paths:
    M clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
    M clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
    M clang/lib/Analysis/FlowSensitive/Transfer.cpp
    M clang/unittests/Analysis/FlowSensitive/TransferTest.cpp

  Log Message:
  -----------
  [clang][dataflow] Add support for return values of reference type.

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

Reviewed By: ymandel, xazax.hun

Differential Revision: https://reviews.llvm.org/D151194




More information about the All-commits mailing list