This is an archive of the discontinued LLVM Phabricator instance.

[CFG] [analyzer] Add construction context when constructor is wrapped into ExprWithCleanups.
ClosedPublic

Authored by NoQ on Jan 30 2018, 4:01 PM.

Details

Summary

As an improvement over D42699 and D42700, this unwraps ExprWithCleanups surrounding immediate constructors of variables which take temporaries as constructor arguments (such as iterator i = begin() - a copy constructor accepts a temporary here).

With this change, we're fully ready to make use of construction contexts in the analyzer (in the next patch). Once we do, the plan is to be adding more and more construction contexts for the new cases that were not previously supported by the analyzer.

Minor refactoring involved.

Diff Detail

Event Timeline

NoQ created this revision.Jan 30 2018, 4:01 PM

With this change, we're fully ready to make use of construction contexts in the analyzer (in the next patch).

The next patch is D42721.

NoQ updated this revision to Diff 132699.Feb 2 2018, 4:14 PM

Rebase.

Add direct tests, though one was already there since D42699 as a fixme.

NoQ edited the summary of this revision. (Show Details)Feb 2 2018, 4:15 PM
NoQ updated this revision to Diff 133142.Feb 6 2018, 7:46 PM

Rebase.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 9 2018, 6:50 PM
This revision was automatically updated to reflect the committed changes.