[cfe-commits] r141334 - in /cfe/trunk: include/clang/Parse/Parser.h include/clang/Sema/Sema.h lib/Parse/ParseObjc.cpp lib/Sema/Sema.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclAttr.cpp lib/Sema/SemaDeclObjC.cpp lib/Sema/SemaExpr.cpp test/SemaObjC/attr-deprecated.m test/SemaObjC/class-unavail-warning.m

Argyrios Kyrtzidis kyrtzidis at apple.com
Fri Oct 7 09:33:16 PDT 2011


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
>>> 
>>> 
>> 
> 




More information about the cfe-commits mailing list