[PATCH] [ms-cxxabi] Destroy temporary record arguments in the callee

John McCall rjmccall at apple.com
Mon Jun 24 11:16:02 PDT 2013


On Jun 24, 2013, at 7:47 AM, Reid Kleckner <rnk at google.com> wrote:
> On Fri, Jun 21, 2013 at 5:01 PM, John McCall <rjmccall at apple.com> wrote:
> On Jun 20, 2013, at 12:49 PM, Reid Kleckner <rnk at google.com> wrote:
>> On Thu, Jun 20, 2013 at 1:37 PM, John McCall <rjmccall at apple.com> wrote:
>> Good point, sorry.
>> 
>> Hmm.  It looks like ActOnStartOfFunctionDef, ActOnStartOfObjCMethodDef, ActOnBlockArguments, and addLambdaParameters all have basically the same loop in them, but doing slightly different checks for no particular reason.  And there's already a CheckParmsForFunctionDef method, but it's apparently not called for ObjC methods.
>> 
>> I think it makes sense to have a single method called in all of these cases which performs the basic checks, sets ownership, and pushes parameters into scope.  That method would be a natural place for your call to FinalizeVarWithDestructor.
>> 
>> I ended up putting it in CheckParmsForFunctionDef.  Probably ObjC methods should be calling that?
> 
> I was hoping that you'd do the refactoring to make that happen. :)
> 
> I did a little with r184740.  There's still some duplication of code like:
>     Param->setOwningFunction(FD);
>     if (Param->getIdentifier() && FnBodyScope) {
>       CheckShadow(FnBodyScope, Param);
>       PushOnScopeChains(Param, FnBodyScope);
>     }
> 
> I guess ObjC methods should be calling CheckShadow?

Yeah, I don't think there's a good reason they don't.

John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130624/38f1c2ae/attachment.html>


More information about the cfe-commits mailing list