From: Fariborz Jahanian Date: Mon, 18 Oct 2010 17:51:06 +0000 (+0000) Subject: patch fixes class names missing from method names in debug information for X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1a4c93777982210306223e9f92bc30c27625208e;p=clang patch fixes class names missing from method names in debug information for synthesized property. // rdar: //8498026 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116717 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj index fa1e24574e..9c95d0a3de 100644 --- a/clang.xcodeproj/project.pbxproj +++ b/clang.xcodeproj/project.pbxproj @@ -2039,7 +2039,6 @@ isa = PBXProject; buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */; compatibilityVersion = "Xcode 2.4"; - developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 224710af35..e8c1ae754d 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -102,6 +102,8 @@ llvm::StringRef CGDebugInfo::getObjCMethodName(const ObjCMethodDecl *OMD) { const DeclContext *DC = OMD->getDeclContext(); if (const ObjCImplementationDecl *OID = dyn_cast(DC)) { OS << OID->getName(); + } else if (const ObjCInterfaceDecl *OID = dyn_cast(DC)) { + OS << OID->getName(); } else if (const ObjCCategoryImplDecl *OCD = dyn_cast(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 index 0000000000..b01f3a2143 --- /dev/null +++ b/test/CodeGenObjC/debug-info-getter-name.m @@ -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; +}