Page MenuHomePhabricator

Implement inlining of temporary destructors.
Needs ReviewPublic

Authored by klimek on Jul 31 2014, 5:16 AM.

Details

Reviewers
jordan_rose

Diff Detail

Event Timeline

klimek updated this revision to Diff 12061.Jul 31 2014, 5:16 AM
klimek retitled this revision from to Implement inlining of temporary destructors..
klimek updated this object.
klimek edited the test plan for this revision. (Show Details)
klimek added a reviewer: jordan_rose.
klimek added subscribers: alexmc, Unknown Object (MLST).

Woo :D nice work!

test/Analysis/temporaries.cpp
106–107

Remove fixme

klimek updated this revision to Diff 12233.Aug 6 2014, 6:43 AM

Added more tests, and a FIXME for the parameter passing test.
Addressed review comments.

klimek updated this revision to Diff 12305.Aug 8 2014, 6:29 AM

Do not inline temporary destructors for temporaries that bind to parameters.

jordan_rose edited edge metadata.Aug 8 2014, 6:16 PM

Do we really need to put the "binds parameter" information in the CFG? I was hoping we could look in the parent map to see how the temporary is used (like for 'new' right now).

include/clang/Analysis/CFG.h
284

Why not just use "self"? Or &T? Why "T"? Why does T require a dynamic allocation?

lib/StaticAnalyzer/Core/ExprEngine.cpp
719–724

This is not how LCVs work. An LCV is a snapshot of a region at a particular "time" (state of the Store); the region may not exist in the current store. The "best" answer in the current scheme is to use createTemporaryRegionIfNeeded, but the right answer may end up being to disregard the rvalue-ness of temporaries (as we talked about some on cfe-dev).

lib/StaticAnalyzer/Core/ProgramState.cpp
508–509 ↗(On Diff #12305)

This is not correct; see above.

klimek updated this revision to Diff 15556.Oct 29 2014, 5:33 PM
klimek edited edge metadata.

Dumping of intermediate state developed with Jordan...