[all-commits] [llvm/llvm-project] 9d6907: [analyzer][NFC] Introduce CXXDeallocatorCall, depl...

Kristóf Umann via All-commits all-commits at lists.llvm.org
Mon May 18 15:19:17 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9d69072fb80755a0029a01c74892b4bf03f20f65
      https://github.com/llvm/llvm-project/commit/9d69072fb80755a0029a01c74892b4bf03f20f65
  Author: Kirstóf Umann <dkszelethus at gmail.com>
  Date:   2020-05-19 (Tue, 19 May 2020)

  Changed paths:
    M clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
    M clang/lib/StaticAnalyzer/Checkers/DeleteWithNonVirtualDtorChecker.cpp
    M clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
    M clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
    M clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
    M clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
    M clang/test/Analysis/cxx-dynamic-memory-analysis-order.cpp
    M clang/unittests/StaticAnalyzer/CMakeLists.txt
    A clang/unittests/StaticAnalyzer/CallEventTest.cpp

  Log Message:
  -----------
  [analyzer][NFC] Introduce CXXDeallocatorCall, deploy it in MallocChecker

One of the pain points in simplifying MallocCheckers interface by gradually
changing to CallEvent is that a variety of C++ allocation and deallocation
functionalities are modeled through preStmt<...> where CallEvent is unavailable,
and a single one of these callbacks can prevent a mass parameter change.

This patch introduces a new CallEvent, CXXDeallocatorCall, which happens after
preStmt<CXXDeleteExpr>, and can completely replace that callback as
demonstrated.

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




More information about the All-commits mailing list