On Jan 15, 2009, at 4:57 PM, Fariborz Jahanian wrote:

> Author: fjahanian
> Date: Thu Jan 15 18:57:08 2009
> New Revision: 62289
>
> URL: http://llvm.org/viewvc/llvm-project?rev=62289&view=rev
> Log:
> Implemented code gen for sizeof(objc class interface).

Nice!

> +++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Thu Jan 15 18:57:08 2009
> @@ -686,7 +686,14 @@
>     Align /= 8;  // Return alignment in bytes, not bits.
>     return llvm::ConstantInt::get(llvm::APInt(ResultWidth, Align));
>   }
> -
> +  if (TypeToSize->isObjCInterfaceType()) {
> +    ObjCInterfaceDecl *OI = TypeToSize->getAsObjCInterfaceType()- 
> >getDecl();
> +    const RecordDecl *RD = CGF.getContext().addRecordToClass(OI);
> +    const Type *Key =
> +      CGF.getContext().getTagDeclType(
> +                     
> const_cast<TagDecl*>(dyn_cast<TagDecl>(RD))).getTypePtr();
> +    TypeToSize = Key->getDesugaredType();

Why call getDesugaredType?

-Chris

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

Reply via email to