[llvm] r255831 - Simplify memory management with std::unique_ptr.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 17 06:12:49 PST 2015


> Looks like now that this doesn't need explicit cleanup, you could remove the
> variable, but that might be a bit unclear:
>
> PrintStatistics(*CreateInfoOutputFile());

That would look odd without a clear indication that it is a unique_ptr.

> Can (or is it already) raw_ostream be made movable? In which case
> CretaeInfoInputFile could return by value? (but I guess then you couldn't
> take a non-const ref to it to pass it to something else anyway...)

It might be possible, but it is not clear if it is worth the effort.

Cheers,
Rafael


More information about the llvm-commits mailing list