This is an archive of the discontinued LLVM Phabricator instance.

[Analysis] Use unique_ptr for CallGraph::FunctionMap.
ClosedPublic

Authored by jlebar on Oct 9 2016, 11:25 PM.

Details

Summary

The decltype(declval) dance in the iterator traits is necessary because
DenseMap iterators aren't over std::pairs, but rather are over a
pair-like type defined in DenseMap. It used to work because we were
making a copy of the pair, but now that we're binding a reference to the
pair, we need to get the type exactly right.

Event Timeline

jlebar updated this revision to Diff 74107.Oct 9 2016, 11:25 PM
jlebar retitled this revision from to [Analysis] Use unique_ptr for CallGraph::FunctionMap..
jlebar updated this object.
jlebar added a reviewer: timshen.
jlebar added a subscriber: cfe-commits.
NoQ added a subscriber: NoQ.Oct 10 2016, 12:47 AM
timshen added inline comments.Oct 10 2016, 2:22 AM
clang/include/clang/Analysis/CallGraph.h
204

Does clang::CallGraph::const_iterator::value_type work?

jlebar marked an inline comment as done.Oct 10 2016, 9:05 AM
jlebar added inline comments.
clang/include/clang/Analysis/CallGraph.h
204

Much better, thanks.

This revision is now accepted and ready to land.Oct 10 2016, 3:33 PM
jlebar closed this revision.Oct 10 2016, 3:33 PM