[PATCH] D42991: [analyzer] NFC: Use EvalCallOptions for destructors as well.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 6 15:59:33 PST 2018


NoQ created this revision.
NoQ added reviewers: dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet.
Herald added subscribers: cfe-commits, rnkovacs.

In https://reviews.llvm.org/D42457 we added the `EvalCallOptions` structure to notify `evalCall()` when some other code believes that there's something fishy about the call, so that this other code didn't make decisions about whether the call needs to be inlined, but instead `evalCall()` itself had all the information presented in a clear manner and could make a well-thought decision. This was initially used for constructors, to notify `evalCall()` that we didn't manage to find the correct region for construction.

Do the same for destructors. The code here is structured differently - we don't have single "`getRegionForDestructor()`" function within `VisitCXXDestructor` (but there is a small part of it - the `makeZeroElementRegion()` part), but we're doing it separately for different CFGElement kinds and only then call `VisitCXXDestructor()` with a ready-made region. I didn't try to change that, apart from moving the `makeZeroElementRegion()` hack out to the caller, so that `EvalCallOptions` were initialized in a single place and then passed by const reference.

Renamed `EvalCallOptions` flags to be more concise.

Accidentally, part of this patch has leaked into https://reviews.llvm.org/D42457, which caused a functional change. This patch reverts that accidental functional change. Apart from that, no functional change is intended.


Repository:
  rC Clang

https://reviews.llvm.org/D42991

Files:
  include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
  lib/StaticAnalyzer/Core/ExprEngine.cpp
  lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
  lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
  test/Analysis/new.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42991.133098.patch
Type: text/x-patch
Size: 14852 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180206/2a13f1a9/attachment-0001.bin>


More information about the cfe-commits mailing list