On Oct 7, 2011, at 9:03 AM, jahanian wrote:

> 
> On Oct 6, 2011, at 5:55 PM, Argyrios Kyrtzidis wrote:
> 
>> 
>> On Oct 6, 2011, at 5:28 PM, Fariborz Jahanian wrote:
>> 
>>> 
>>>>  ObjCImpDecl = ImplCatType;
>>>>  PendingObjCImpDecl.push_back(ObjCImpDecl);
>>>>  return 0;
>>>> @@ -1466,7 +1465,6 @@
>>>> if (Tok.is(tok::l_brace)) // we have ivars
>>>>  ParseObjCClassInstanceVariables(ImplClsType, tok::objc_private, atLoc);
>>>> 
>>>> -  Actions.ActOnObjCContainerStartDefinition(ImplClsType);
>>> And this?
>>> 
>> 
>> Pushing context moved inside Sema, the context is pushed now by:
>> 
>> ActOnStartCategoryInterface / ActOnStartCategoryImplementation
>> ActOnStartClassInterface / ActOnStartClassImplementation
>> ActOnStartProtocolInterface
> 
> OK I see. I am not sure the rational for this change (other than moving the 
> push to Sema).

It's to get it consistent with how it works in rest of the parser, where Sema 
is the one that does the declaration context switches not the parser directly.

ActOnObjCContainer[Start/Finish]Definition calls were used as such context 
switches and they were not "rational" from the perspective of Sema, e.g. for 
parsing obj typenames:

-ActOnStartCategoryInterface
-ActOnObjCContainerStartDefinition
-<..>
-ActOnObjCContainerFinishDefinition
-<parse type>
-ActOnObjCContainerStartDefinition
-<..>
-ActOnObjCContainerFinishDefinition
-<parse type>
-ActOnObjCContainerStartDefinition
-<..>
-ActOnAtEnd
-ActOnObjCContainerFinishDefinition

Now it is the more "descriptive":

-ActOnStartCategoryInterface
-<..>
-ActOnObjCTemporaryExitContainerContext
-<parse type>
-ActOnObjCReenterContainerContext
-<..>
-ActOnObjCTemporaryExitContainerContext
-<parse type>
-ActOnObjCReenterContainerContext
-<..>
-ActOnAtEnd

I intend to eventually remove ActOnObjCContainer[Start/Finish]Definition or at 
least rename+make it private.

> But it is refactoring so it looks OK to me.
> 
> - Thanks, Fariborz
> 
>> 
>> then it gets popped by
>> 
>> ActOnAtEnd
>> 
>> 
>>> - Fariborz
>>> 
>>> 
>> 
> 

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to