[PATCH] D15911: Move ownership of Action objects into Compilation.

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 8 10:56:08 PST 2016


On Fri, Jan 8, 2016 at 10:55 AM, David Blaikie <dblaikie at gmail.com> wrote:

>
>
> On Fri, Jan 8, 2016 at 10:08 AM, Artem Belevich via cfe-commits <
> cfe-commits at lists.llvm.org> wrote:
>
>> tra added inline comments.
>>
>> ================
>> Comment at: include/clang/Driver/Action.h:36
>> @@ -35,1 +35,3 @@
>> +///
>> +/// Actions are usually owned by a Compilation.
>>  class Action {
>> ----------------
>> There's no API to pass ownership to Compilation explicitly, so the only
>> way for an Action to be owned by Compilation is to create it with
>> MakeAction.
>>
>> Perhaps "Actions created with MakeAction<>() are owned by Compilation"
>>
>> BTW, should we (can we?) make MakeAction<>() the only way to create
>> actions?
>>
>
> I suspect not - from an API design perspective it might be nice to be able
> to test Actions in isolation without the Compilation (I assume this isn't
> being done, because we don't unit test all that much - and I don't know the
> APIs well enough to know if such testing makes sense (maybe Action and
> Compilation are too tied together to do that separation anyway))
>

(but if we wanted to, we could, by making each Action subclass's ctor
private and friending Compilation from them - might be a bit repetitious
though)


>
>
>>
>>
>> http://reviews.llvm.org/D15911
>>
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160108/fe2b0500/attachment.html>


More information about the cfe-commits mailing list