[all-commits] [llvm/llvm-project] 5d22d1: [clang][dataflow] Improve optional model's support...

Yitzhak Mandelbaum via All-commits all-commits at lists.llvm.org
Thu Dec 15 07:41:56 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5d22d1f54836263ead1971ef8128f5128290dfa7
      https://github.com/llvm/llvm-project/commit/5d22d1f54836263ead1971ef8128f5128290dfa7
  Author: Yitzhak Mandelbaum <yitzhakm at google.com>
  Date:   2022-12-15 (Thu, 15 Dec 2022)

  Changed paths:
    M clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h
    M clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp
    M clang/unittests/Analysis/FlowSensitive/UncheckedOptionalAccessModelTest.cpp

  Log Message:
  -----------
  [clang][dataflow] Improve optional model's support for ignoring smart pointers.

The optional model has an option to ignore optionals accessed through smart
pointer types (other than optional itself). This patch improves this feature in
two ways:

1. We extend support to optionals accessed directly through the smart pointer,
like `ptr->value()`. Previously, support was limited to cases that went through
an intermediate field.

2. We clean up the implementation by removing the option from the analysis,
leaving it only in the diagnostic phase (where it is relevant).

3. Adjusts a test which was misleading in what it was testing.

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




More information about the All-commits mailing list