[cfe-commits] r129626 - in /cfe/trunk/lib/CodeGen: CGDebugInfo.cpp CGDebugInfo.h

Fariborz Jahanian fjahanian at apple.com
Fri Apr 15 17:59:36 PDT 2011


On Apr 15, 2011, at 5:55 PM, Fariborz Jahanian wrote:

> Hi Devang,
> 
> You go through the list of ivars and try to match them with a property name. This need not be the case, as user might say:
> @synthesize MyProperty=AnIvar;
> 
> Instead, you should iterate over the list of properties declared in the interface class and generate the debug info. for them.

Also, watch out the 'readonly' properties do not have setter methods.

- Fariborz

> 
> - Fariborz
> 
> On Apr 15, 2011, at 5:37 PM, Devang Patel wrote:
> 
>> Author: dpatel
>> Date: Fri Apr 15 19:37:51 2011
>> New Revision: 129626
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=129626&view=rev
>> Log:
>> Emit proper selector name in debug info.
>> 
>> Modified:
>>   cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>>   cfe/trunk/lib/CodeGen/CGDebugInfo.h
>> 
>> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=129626&r1=129625&r2=129626&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
>> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Apr 15 19:37:51 2011
>> @@ -119,6 +119,17 @@
>>  return llvm::StringRef(StrPtr, OS.tell());
>> }
>> 
>> +/// getSelectporName - Return selector name. This is used for debugging
>> +/// info.
>> +llvm::StringRef CGDebugInfo::getSelectorName(Selector S) {
>> +  llvm::SmallString<256> SName;
>> +  llvm::raw_svector_ostream OS(SName);
>> +  OS << S.getAsString();
>> +  char *StrPtr = DebugInfoNames.Allocate<char>(OS.tell());
>> +  memcpy(StrPtr, SName.begin(), OS.tell());
>> +  return llvm::StringRef(StrPtr, OS.tell());
>> +}
>> +
>> /// getClassName - Get class name including template argument list.
>> llvm::StringRef 
>> CGDebugInfo::getClassName(RecordDecl *RD) {
>> @@ -1198,8 +1209,8 @@
>>    if (ObjCPropertyDecl *PD =
>>        ID->FindPropertyVisibleInPrimaryClass(Field->getIdentifier())) {
>>      PropertyName = PD->getName();
>> -      PropertyGetter = PD->getGetterName().getNameForSlot(0);
>> -      PropertySetter = PD->getSetterName().getNameForSlot(0);
>> +      PropertyGetter = getSelectorName(PD->getGetterName());
>> +      PropertySetter = getSelectorName(PD->getSetterName());
>>      PropertyAttributes = PD->getPropertyAttributes();
>>    }
>>    FieldTy = DBuilder.createObjCIVar(FieldName, FieldDefUnit,
>> 
>> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.h
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=129626&r1=129625&r2=129626&view=diff
>> ==============================================================================
>> --- cfe/trunk/lib/CodeGen/CGDebugInfo.h (original)
>> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.h Fri Apr 15 19:37:51 2011
>> @@ -267,6 +267,10 @@
>>  /// This is the display name for the debugging info.  
>>  llvm::StringRef getObjCMethodName(const ObjCMethodDecl *FD);
>> 
>> +  /// getSelectporName - Return selector name. This is used for debugging
>> +  /// info.
>> +  llvm::StringRef getSelectorName(Selector S);
>> +
>>  /// getClassName - Get class name including template argument list.
>>  llvm::StringRef getClassName(RecordDecl *RD);
>> 
>> 
>> 
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 
> _______________________________________________
> 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