[cfe-commits] r61231 - /cfe/trunk/lib/AST/ASTContext.cpp

Fariborz Jahanian fjahanian at apple.com
Fri Dec 19 08:59:55 PST 2008


On Dec 18, 2008, at 5:43 PM, Daniel Dunbar wrote:

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

Sure. These patches came because of dejagnu test failures. There are  
still more issues
that I am looking at. But tests will come first. Unfortunately,  
encoding mismatches are
hard to find because they cause silent runtime failures. And dejagnu  
tests use them
for other purposes than testing @encode.

- fariborz

>
>
> - Daniel
>
> On Thu, Dec 18, 2008 at 4:14 PM, Fariborz Jahanian <fjahanian at apple.com 
> > 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:
>> Several at 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
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>




More information about the cfe-commits mailing list