[LLVMdev] New type of smart pointer for LLVM

Duncan P. N. Exon Smith dexonsmith at apple.com
Thu Oct 2 09:11:16 PDT 2014


> On Oct 1, 2014, at 3:53 PM, Chandler Carruth <chandlerc at google.com> wrote:
> 
> I even question whether we need a "maybe owning" smart pointer, or whether this is just an indication that the underlying data structure is *wrong*. The idea of "maybe" and "owning" going to gether, in any sense, seems flat out broken to me from a design perspective,

I absolutely agree with this.

> and so I'm not enthused about providing abstractions that make it easier to build systems with unclear ownership semantics.

We have a number of APIs that use this model, without abstractions.  To
the extent that providing the abstraction encourages the model, it's
dangerous.  But if it helps to clarify the code that's already there and
facilitates a transition to better models, then it might be worthwhile
anyway.



More information about the llvm-dev mailing list