]> granicus.if.org Git - clang/commitdiff
patch fixes class names missing from method names in debug information for
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 18 Oct 2010 17:51:06 +0000 (17:51 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 18 Oct 2010 17:51:06 +0000 (17:51 +0000)
synthesized property. // rdar: //8498026

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116717 91177308-0d34-0410-b5e6-96231b3b80d8

clang.xcodeproj/project.pbxproj
lib/CodeGen/CGDebugInfo.cpp
test/CodeGenObjC/debug-info-getter-name.m [new file with mode: 0644]

index fa1e24574e8f6ff71d0892d96891c27ec9d1669e..9c95d0a3dee5c0ed6924daa5c0242b6448d219d0 100644 (file)
                        isa = PBXProject;
                        buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
                        compatibilityVersion = "Xcode 2.4";
-                       developmentRegion = English;
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,
index 224710af3573a9dbb7283ec92b77916d94edf4f0..e8c1ae754d23a3bc885f0140aa2eda7c5a831f02 100644 (file)
@@ -102,6 +102,8 @@ llvm::StringRef CGDebugInfo::getObjCMethodName(const ObjCMethodDecl *OMD) {
   const DeclContext *DC = OMD->getDeclContext();
   if (const ObjCImplementationDecl *OID = dyn_cast<const ObjCImplementationDecl>(DC)) {
      OS << OID->getName();
+  } else if (const ObjCInterfaceDecl *OID = dyn_cast<const ObjCInterfaceDecl>(DC)) {
+      OS << OID->getName();
   } else if (const ObjCCategoryImplDecl *OCD = dyn_cast<const ObjCCategoryImplDecl>(DC)){
       OS << ((NamedDecl *)OCD)->getIdentifier()->getNameStart() << '(' <<
           OCD->getIdentifier()->getNameStart() << ')';
diff --git a/test/CodeGenObjC/debug-info-getter-name.m b/test/CodeGenObjC/debug-info-getter-name.m
new file mode 100644 (file)
index 0000000..b01f3a2
--- /dev/null
@@ -0,0 +1,50 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi2 -S -g %s -o %t
+// RUN: grep "\[InstanceVariablesEverywhereButTheInterface someString\]" %t | count 7
+
+//rdar: //8498026
+
+@class NSString;
+
+@interface InstanceVariablesEverywhereButTheInterface 
+@end
+
+@interface InstanceVariablesEverywhereButTheInterface()
+{
+  NSString *_someString;
+}
+
+@property(readonly) NSString *someString;
+@property(readonly) unsigned long someNumber;
+@end
+
+@implementation InstanceVariablesEverywhereButTheInterface
+{
+  unsigned long _someNumber;
+}
+
+@synthesize someString = _someString, someNumber = _someNumber;
+
+- init {
+  return self;
+}
+@end
+
+@interface AutomaticSynthesis 
+{
+  int real_ivar;
+}
+@property(copy) NSString *someString;
+@property unsigned long someNumber;
+@end
+
+@implementation AutomaticSynthesis
+- init
+{
+  return self;
+}
+@end
+
+int main()
+{
+  return 0;
+}