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

Devang Patel dpatel at apple.com
Fri Apr 15 17:12:56 PDT 2011


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);
   }
 

Added: cfe/trunk/test/CodeGenObjC/debug-info-property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/debug-info-property.m?rev=129625&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/debug-info-property.m (added)
+++ cfe/trunk/test/CodeGenObjC/debug-info-property.m Fri Apr 15 19:12:55 2011
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -masm-verbose -S -g %s -o - | FileCheck %s
+
+// CHECK: AT_APPLE_property_name
+ at interface I1 {
+int p1;
+}
+ at property int p1;
+ at end
+
+ at implementation I1
+ at synthesize p1;
+ at end





More information about the cfe-commits mailing list