This is an archive of the discontinued LLVM Phabricator instance.

Use unique_ptr in LLVMContextImpl's constant maps.
ClosedPublic

Authored by jlebar on Oct 9 2016, 10:22 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

jlebar updated this revision to Diff 74097.Oct 9 2016, 10:22 PM
jlebar retitled this revision from to Use unique_ptr in LLVMContextImpl's constant maps..
jlebar updated this object.
jlebar added a reviewer: timshen.
jlebar added a subscriber: cfe-commits.
timshen added inline comments.Oct 10 2016, 1:40 AM
llvm/lib/IR/LLVMContextImpl.cpp
106 ↗(On Diff #74097)

Do you want to change this one as well?

jlebar marked an inline comment as done.Oct 10 2016, 9:14 AM
jlebar added inline comments.
llvm/lib/IR/LLVMContextImpl.cpp
106 ↗(On Diff #74097)

Sure, but this one is complicated enough I'll put it in its own patch.

jlebar marked 2 inline comments as done.Oct 10 2016, 9:14 AM
jlebar added inline comments.Oct 10 2016, 9:22 AM
llvm/lib/IR/LLVMContextImpl.cpp
106 ↗(On Diff #74097)

Actually, this one is very complicated, because we're walking a linked list where the head is now a unique_ptr but the other elements are raw pointers, and we assume we can assign into any of them using generic code...

I'll save it for another day. I'd call DeleteContainerSeconds, but that doesn't work because the destructors of the map's value types are protected... :)

timshen accepted this revision.Oct 10 2016, 8:36 PM
timshen edited edge metadata.
This revision is now accepted and ready to land.Oct 10 2016, 8:36 PM
This revision was automatically updated to reflect the committed changes.