[cfe-commits] r42311 - in /cfe/trunk: AST/Decl.cpp Parse/MinimalAction.cpp Parse/ParseObjc.cpp Sema/Sema.h Sema/SemaDecl.cpp clang.xcodeproj/project.pbxproj include/clang/AST/ASTContext.h include/clang/AST/Decl.h include/clang/Basic/DiagnosticKinds.def include/clang/Parse/Action.h test/Sema/class-def-test-1.m test/Sema/class-impl-1.m
Fariborz Jahanian
fjahanian at apple.com
Thu Oct 4 14:55:49 PDT 2007
On Oct 4, 2007, at 2:52 PM, Devang Patel wrote:
>
> On Oct 4, 2007, at 12:24 PM, Fariborz Jahanian wrote:
>
>>> an implementation decl object is made.
>>>
>>> Would it be feasible to handle this like we do for struct forward
>>> definitions, where the definition of a struct goes back and fills in
>>> the declaration with the implementation info? It seems strange to
>>> me that objc code like this:
>>>
>>> @interface OBJECT @end
>>> @interface INTF : OBJECT
>>> @end
>>> @implementation INTF @end
>>>
>>> Creates an 'ObjcInterfaceDecl' for INTF, then a separate
>>> 'ObjcImplementationDecl' later, which isn't added to the scope
>>> info. If it were, you could drop this linear time lookup code:
>>
>> ObjcInterfaceDecl and ObjcImplementationDecl are not same as 'struct
>> S'. ObjcInterfaceDecl is part of the type system.
>> ObjcImplementationDecl is a node which encapsulates information about
>> methods which have implementations (definitions) in current TU.
>
> I'm curious - How is "@class INTF; " represented in AST nodes ?
> Does it make sense to drop "Decl" from ObjcInterfaceDecl and
> ObjcImplementation ?
It is a forward class declaration. There is a field in
ObjcInterfaceDecl fto declare forward class declaration.
- fariborz
>
>
> -
> Devang
More information about the cfe-commits
mailing list