r206986 - Replacing a naked pointer with a unique_ptr. No functional changes intended.

Aaron Ballman aaron at aaronballman.com
Wed Apr 23 10:18:34 PDT 2014


On Wed, Apr 23, 2014 at 1:08 PM, David Blaikie <dblaikie at gmail.com> wrote:
> On Wed, Apr 23, 2014 at 7:26 AM, Aaron Ballman <aaron at aaronballman.com> wrote:
>> Author: aaronballman
>> Date: Wed Apr 23 09:26:59 2014
>> New Revision: 206986
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=206986&view=rev
>> Log:
>> Replacing a naked pointer with a unique_ptr. No functional changes intended.
>
> Any particular reason this needs to be dynamically allocated (it
> doesn't appear to be polymorphic - but perhaps it will be in the
> future?)? Would Optional<CallingContext> suffice?

I think it would be possible to do -- CallingContext::Prev would have
to change to be Optional<CallingContext> Prev, but I don't see the
extra copies being overly expensive. I'll let DeLesley make the call
since this is in perf-sensitive code.

~Aaron



More information about the cfe-commits mailing list