[cfe-commits] r129625 - in /cfe/trunk: lib/CodeGen/CGDebugInfo.cpp test/CodeGenObjC/debug-info-property.m

Benjamin Kramer benny.kra at googlemail.com
Sat Apr 16 03:33:34 PDT 2011


On 16.04.2011, at 02:12, Devang Patel wrote:

> Author: dpatel
> Date: Fri Apr 15 19:12:55 2011
> New Revision: 129625
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=129625&view=rev
> Log:
> Emit debug info for Objective-C properties.
> 
> Added:
>    cfe/trunk/test/CodeGenObjC/debug-info-property.m
> Modified:
>    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> 
> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=129625&r1=129624&r2=129625&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Apr 15 19:12:55 2011
> @@ -1191,9 +1191,22 @@
>     else if (Field->getAccessControl() == ObjCIvarDecl::Private)
>       Flags = llvm::DIDescriptor::FlagPrivate;
> 
> -    FieldTy = DBuilder.createMemberType(FieldName, FieldDefUnit,
> -                                        FieldLine, FieldSize, FieldAlign,
> -                                        FieldOffset, Flags, FieldTy);
> +    llvm::StringRef PropertyName;
> +    llvm::StringRef PropertyGetter;
> +    llvm::StringRef PropertySetter;
> +    unsigned PropertyAttributes;
> +    if (ObjCPropertyDecl *PD =
> +        ID->FindPropertyVisibleInPrimaryClass(Field->getIdentifier())) {
> +      PropertyName = PD->getName();
> +      PropertyGetter = PD->getGetterName().getNameForSlot(0);
> +      PropertySetter = PD->getSetterName().getNameForSlot(0);
> +      PropertyAttributes = PD->getPropertyAttributes();
> +    }
> +    FieldTy = DBuilder.createObjCIVar(FieldName, FieldDefUnit,
> +                                      FieldLine, FieldSize, FieldAlign,
> +                                      FieldOffset, Flags, FieldTy,
> +                                      PropertyName, PropertyGetter,
> +                                      PropertySetter, PropertyAttributes);
>     EltTys.push_back(FieldTy);
>   }

Is it intended to create an ObjCIVar with an empty name if it's not visible in the primary class? Also PropertyAttributes will be used uninitialized in that case, which causes failures on the valgrind buildbot.



More information about the cfe-commits mailing list