ymand wrote:
> > Ugh, I wonder if this is unintentional and we should change the
> > implementation of these data structures. I also find this behavior very
> > surprising.
>
> I can try changing the data structure. Let me do that in a separate PR. It
> would need an extra Value comparison which needs to be done [while inserting
> the
> element](https://github.com/llvm/llvm-project/blob/e2467cbfa8fdc440debac1cfb930ee476f3d5e42/llvm/include/llvm/ADT/ImmutableSet.h#L542)
> and this could be a slight concern for other users. Let me give it a try.
Seems like its a bug, based on the comment for `add`:
```
/// add - ... If
/// the original set already included the value, then the original set is
/// returned and no memory is allocated. ...
```
https://github.com/llvm/llvm-project/pull/159582
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits