[PATCH] D125899: [ADT] Add copy constructor to IntervalMap

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 18 10:18:35 PDT 2022


dblaikie added a comment.

In D125899#3522879 <https://reviews.llvm.org/D125899#3522879>, @kparzysz wrote:

> Changed the copy to a deep one.

Ah, if the type wasn't deep copying before - ie: its default copy operation wasn't actually valid/probably would've resulted in duplicate free/delete/etc and generally been broken. Then my use case was just getting lucky because it was copying empty maps.

If that's the case, then maybe that does argue in favor of the unique_ptr solution/marking the broken copy ctor as deleted. (or figuring out some way to do the construction in-place in my case without using copying)

I'll take a closer look.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125899/new/

https://reviews.llvm.org/D125899



More information about the llvm-commits mailing list