Nice, I hadn't seen these discrepancies... I was using SingleSource/UnitTests/ObjC/print-class-info.m in the LLVM test suite to check the encoding and verify that it matched gcc (using the ObjC runtime functions to iterate over the metadata and print the information from it).
Can you make sure that this file has a test case which covers this code, if it doesn't already? - Daniel On Thu, Dec 18, 2008 at 4:14 PM, Fariborz Jahanian <[email protected]> wrote: > Author: fjahanian > Date: Thu Dec 18 18:14:49 2008 > New Revision: 61231 > > URL: http://llvm.org/viewvc/llvm-project?rev=61231&view=rev > Log: > seve...@encode bug fixes for ObjC. > > Modified: > cfe/trunk/lib/AST/ASTContext.cpp > > Modified: cfe/trunk/lib/AST/ASTContext.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=61231&r1=61230&r2=61231&view=diff > > ============================================================================== > --- cfe/trunk/lib/AST/ASTContext.cpp (original) > +++ cfe/trunk/lib/AST/ASTContext.cpp Thu Dec 18 18:14:49 2008 > @@ -1779,9 +1779,17 @@ > } > else if (const PointerType *PT = T->getAsPointerType()) { > QualType PointeeTy = PT->getPointeeType(); > - if (isObjCIdType(PointeeTy) || PointeeTy->isObjCInterfaceType()) { > + if (isObjCIdType(PointeeTy)) { > S += '@'; > return; > + } > + else if (PointeeTy->isObjCInterfaceType()) { > + S += '@'; > + ObjCInterfaceDecl *OI = PointeeTy->getAsObjCInterfaceType()->getDecl(); > + S += '"'; > + S += OI->getNameAsCString(); > + S += '"'; > + return; > } else if (isObjCClassType(PointeeTy)) { > S += '#'; > return; > @@ -1802,7 +1810,7 @@ > S += '^'; > getObjCEncodingForTypeImpl(PT->getPointeeType(), S, > false, ExpandPointedToStructures, > - NameFields); > + false); > } else if (const ArrayType *AT = > // Ignore type qualifiers etc. > dyn_cast<ArrayType>(T->getCanonicalTypeInternal())) { > > > _______________________________________________ > cfe-commits mailing list > [email protected] > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
