Author: echristo
Date: Thu Apr  5 17:03:32 2012
New Revision: 154129

URL: http://llvm.org/viewvc/llvm-project?rev=154129&view=rev
Log:
Only emit the getter and setter names if they're not the default
synthesized ones. Reasonable debug info size reduction for objc.

rdar://11179756

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
    cfe/trunk/test/CodeGenObjC/debug-info-property.m
    cfe/trunk/test/CodeGenObjC/debug-info-property3.m
    cfe/trunk/test/CodeGenObjC/debug-info-property4.m

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=154129&r1=154128&r2=154129&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Apr  5 17:03:32 2012
@@ -1327,10 +1327,14 @@
     SourceLocation Loc = PD->getLocation();
     llvm::DIFile PUnit = getOrCreateFile(Loc);
     unsigned PLine = getLineNumber(Loc);
+    ObjCMethodDecl *Getter = PD->getGetterMethodDecl();
+    ObjCMethodDecl *Setter = PD->getSetterMethodDecl();
     llvm::MDNode *PropertyNode =
       DBuilder.createObjCProperty(PD->getName(),
                                  PUnit, PLine,
+                                  (Getter && Getter->isImplicit()) ? "" :
                                   getSelectorName(PD->getGetterName()),
+                                  (Setter && Setter->isImplicit()) ? "" :
                                   getSelectorName(PD->getSetterName()),
                                   PD->getPropertyAttributes(),
                                  getOrCreateType(PD->getType(), PUnit));
@@ -1388,13 +1392,17 @@
          SourceLocation Loc = PD->getLocation();
          llvm::DIFile PUnit = getOrCreateFile(Loc);
          unsigned PLine = getLineNumber(Loc);
-         PropertyNode =
-           DBuilder.createObjCProperty(PD->getName(),
-                                       PUnit, PLine,
+          ObjCMethodDecl *Getter = PD->getGetterMethodDecl();
+          ObjCMethodDecl *Setter = PD->getSetterMethodDecl();
+          PropertyNode =
+            DBuilder.createObjCProperty(PD->getName(),
+                                        PUnit, PLine,
+                                        (Getter && Getter->isImplicit()) ? "" :
                                         getSelectorName(PD->getGetterName()),
+                                        (Setter && Setter->isImplicit()) ? "" :
                                         getSelectorName(PD->getSetterName()),
-                                       PD->getPropertyAttributes(),
-                                       getOrCreateType(PD->getType(),PUnit));
+                                        PD->getPropertyAttributes(),
+                                        getOrCreateType(PD->getType(), PUnit));
         }
       }
     }

Modified: cfe/trunk/test/CodeGenObjC/debug-info-property.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/debug-info-property.m?rev=154129&r1=154128&r2=154129&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/debug-info-property.m (original)
+++ cfe/trunk/test/CodeGenObjC/debug-info-property.m Thu Apr  5 17:03:32 2012
@@ -1,8 +1,6 @@
 // RUN: %clang_cc1 -masm-verbose -S -g %s -o - | FileCheck %s
 
 // CHECK: AT_APPLE_property_name
-// CHECK: AT_APPLE_property_getter
-// CHECK: AT_APPLE_property_setter
 // CHECK: AT_APPLE_property_attribute
 // CHECK: AT_APPLE_property
 @interface I1 {

Modified: cfe/trunk/test/CodeGenObjC/debug-info-property3.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/debug-info-property3.m?rev=154129&r1=154128&r2=154129&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/debug-info-property3.m (original)
+++ cfe/trunk/test/CodeGenObjC/debug-info-property3.m Thu Apr  5 17:03:32 2012
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -S -emit-llvm -g %s -o - | FileCheck %s
 
-// CHECK: metadata !"p1", metadata !6, i32 5, metadata !"p1", metadata 
!"setP1:", i32 2316, metadata !9} ; [ DW_TAG_APPLE_property ]
+// CHECK: metadata !"p1", metadata !6, i32 5, metadata !"", metadata !"", i32 
2316, metadata !9} ; [ DW_TAG_APPLE_property ]
 @interface I1
 @property int p1;
 @end

Modified: cfe/trunk/test/CodeGenObjC/debug-info-property4.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/debug-info-property4.m?rev=154129&r1=154128&r2=154129&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenObjC/debug-info-property4.m (original)
+++ cfe/trunk/test/CodeGenObjC/debug-info-property4.m Thu Apr  5 17:03:32 2012
@@ -1,8 +1,6 @@
 // RUN: %clang_cc1 -fobjc-default-synthesize-properties -masm-verbose -S -g %s 
-o - | FileCheck %s
 
 // CHECK: AT_APPLE_property_name
-// CHECK: AT_APPLE_property_getter
-// CHECK: AT_APPLE_property_setter
 // CHECK: AT_APPLE_property_attribute
 // CHECK: AT_APPLE_property
 


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to