[cfe-commits] r42776 - in /cfe/trunk: CodeGen/CodeGenTypes.cpp Driver/ASTConsumers.cpp Parse/ParseObjc.cpp clang.xcodeproj/project.pbxproj include/clang/AST/Type.h

Chris Lattner clattner at apple.com
Mon Oct 8 20:13:19 PDT 2007


> URL: http://llvm.org/viewvc/llvm-project?rev=42776&view=rev
> Log:
> Added a new class for Interfaces qualified by protocol list.
> Protocols are now sorted and made unique in the list.
> Enhanced pretty printer for @interface (So, I can see the protocol  
> list).

Very nice.

> +/// - ObjcQualifiedInterfaceType - This class represense interface  
> types

No need for the " -" at the start, also typo "represense".

> +/// conforming to a list of protocols; such as, INTF<Proto1,  
> Proto2, Proto1>.

I'd explicitly have the comment talk about the fact that duplicate  
protocols are removed and the protocol list is canonicalized to to be  
in alphabetic order.

Otherwise, the class looks good.  The ctor will probably need a way  
to fill in the Protocols list though :).

-Chris

> +class ObjcQualifiedInterfaceType : public Type {
> +  // Interface type for this protocol conforming object type
> +  ObjcInterfaceType *InterfaceType;
> +
> +  // List of protocols for this protocol conforming object type
> +  // List is sorted on protocol name. No protocol is enterred more  
> than once.
> +  llvm::SmallVector<ObjcProtocolDecl*, 8> Protocols;
> +
> +  ObjcQualifiedInterfaceType(ObjcInterfaceType *T) :
> +    Type(ObjcQualifiedInterface, QualType()), InterfaceType(T) { }
> +public:
> +
> +  ObjcInterfaceType *getInterfaceType() const { return  
> InterfaceType; }
> +
> +  static bool classof(const Type *T) {
> +    return T->getTypeClass() == ObjcQualifiedInterface;
> +  }
> +  static bool classof(const ObjcQualifiedInterfaceType *) { return  
> true; }
> +};
> +
>  /// RecordType - This is a helper class that allows the use of isa/ 
> cast/dyncast
>  /// to detect TagType objects of structs/unions/classes.
>  class RecordType : public TagType {
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list