Page MenuHomePhabricator

ScalarEvolution: Make required passes transitive to prevent dangling pointers
ClosedPublic

Authored by srking on Jul 15 2015, 12:19 PM.

Details

Reviewers
hfinkel
Summary

ScalarEvolution stores long lived raw pointers to objects owned by unique_ptrs in other passes. In ScalarEvolution, change addRequired() to addRequiredTransitive() to prevent required passes from being freed and thus preven dangling raw pointers.

IMHO, the current design needs a FIXME to eliminate the long lived raw pointers altogether. Barring that, some way to assert() if the raw pointers becomes dangling would help.

Diff Detail

Event Timeline

srking updated this revision to Diff 29812.Jul 15 2015, 12:19 PM
srking retitled this revision from to ScalarEvolution: Make required passes transitive to prevent dangling pointers.
srking updated this object.
srking added a subscriber: llvm-commits.
hfinkel accepted this revision.Jul 15 2015, 12:29 PM
hfinkel added a reviewer: hfinkel.
hfinkel added a subscriber: hfinkel.

LGTM.

This revision is now accepted and ready to land.Jul 15 2015, 12:29 PM
craig.topper closed this revision.Jul 23 2015, 12:35 AM
craig.topper added a subscriber: craig.topper.

Committed in r242989