This is an archive of the discontinued LLVM Phabricator instance.

Remove redundant pointer map lookup
AbandonedPublic

Authored by davidxl on Aug 11 2016, 3:37 PM.

Details

Reviewers
mkuper

Diff Detail

Event Timeline

davidxl updated this revision to Diff 67762.Aug 11 2016, 3:37 PM
davidxl retitled this revision from to Remove redundant pointer map lookup.
davidxl updated this object.
davidxl added a reviewer: mkuper.
davidxl added a subscriber: llvm-commits.
mkuper requested changes to this revision.Aug 11 2016, 3:52 PM
mkuper edited edge metadata.

It looks like this is on purpose:

https://reviews.llvm.org/rL68047
"getEntryFor() may invalidate DenseMap iterator.
Walking an invalidated iterator is not a good idea."

I think this is still true, but we should probably add a comment.

This revision now requires changes to proceed.Aug 11 2016, 3:52 PM
davidxl abandoned this revision.Aug 11 2016, 4:15 PM

It'd be nice if the getEntryFor API provided a way for the caller to know if an insertion happened (i.e. using an API like insert()).