Page MenuHomePhabricator

[analyzer] Use EvalCallOptions for destructors as well.
ClosedPublic

Authored by NoQ on Feb 6 2018, 3:59 PM.

Details

Summary

In 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 D42457, which caused a functional change. This patch reverts that accidental functional change. Apart from that, no functional change is intended.

Diff Detail

Repository
rL LLVM

Event Timeline

NoQ created this revision.Feb 6 2018, 3:59 PM
NoQ retitled this revision from [analyzer] NFC: Use EvalCallOptions for destructors as well. to [analyzer] Use EvalCallOptions for destructors as well..Feb 6 2018, 4:00 PM
NoQ updated this revision to Diff 133106.Feb 6 2018, 4:05 PM

Remove a couple of accidental blank lines.

NoQ updated this revision to Diff 133299.Feb 7 2018, 1:46 PM

Remove the check in shouldInlineCall() as well. It's quite covered by the IsConstructorWithImproperlyModeledTargetRegion check.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 14 2018, 6:54 PM
Closed by commit rL325209: [analyzer] Decide on inlining destructors via EvalCallOptions. (authored by dergachev, committed by ). · Explain Why
This revision was automatically updated to reflect the committed changes.