aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2012-03-29 17:31:33 +0000
committerEric Christopher <echristo@apple.com>2012-03-29 17:31:33 +0000
commitecae5965cf0c95a357e47227eeb2ec391672840d (patch)
treeb098d25f24b1e4a950f0ce64e1a4e52ba0239298
parent16098f366097305c348b356a44638d6c959c6e60 (diff)
Go back to using just the selector name for the getter and setter
in the property debug info. Any more isn't necessary after all. rdar://11144023 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153659 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp21
-rw-r--r--test/CodeGenObjC/debug-info-property3.m2
2 files changed, 14 insertions, 9 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index fa26d4706d..af55a86a59 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -165,6 +165,15 @@ StringRef CGDebugInfo::getObjCMethodName(const ObjCMethodDecl *OMD) {
return StringRef(StrPtr, OS.tell());
}
+/// getSelectorName - Return selector name. This is used for debugging
+/// info.
+StringRef CGDebugInfo::getSelectorName(Selector S) {
+ const std::string &SName = S.getAsString();
+ char *StrPtr = DebugInfoNames.Allocate<char>(SName.size());
+ memcpy(StrPtr, SName.data(), SName.size());
+ return StringRef(StrPtr, SName.size());
+}
+
/// getClassName - Get class name including template argument list.
StringRef
CGDebugInfo::getClassName(const RecordDecl *RD) {
@@ -1318,13 +1327,11 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
SourceLocation Loc = PD->getLocation();
llvm::DIFile PUnit = getOrCreateFile(Loc);
unsigned PLine = getLineNumber(Loc);
- ObjCMethodDecl *GDecl = PD->getGetterMethodDecl();
- ObjCMethodDecl *SDecl = PD->getSetterMethodDecl();
llvm::MDNode *PropertyNode =
DBuilder.createObjCProperty(PD->getName(),
PUnit, PLine,
- GDecl ? getObjCMethodName(GDecl) : "",
- SDecl ? getObjCMethodName(SDecl) : "",
+ getSelectorName(PD->getGetterName()),
+ getSelectorName(PD->getSetterName()),
PD->getPropertyAttributes(),
getOrCreateType(PD->getType(), PUnit));
EltTys.push_back(PropertyNode);
@@ -1381,13 +1388,11 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
SourceLocation Loc = PD->getLocation();
llvm::DIFile PUnit = getOrCreateFile(Loc);
unsigned PLine = getLineNumber(Loc);
- ObjCMethodDecl *GDecl = PD->getGetterMethodDecl();
- ObjCMethodDecl *SDecl = PD->getSetterMethodDecl();
PropertyNode =
DBuilder.createObjCProperty(PD->getName(),
PUnit, PLine,
- GDecl ? getObjCMethodName(GDecl) : "",
- SDecl ? getObjCMethodName(SDecl) : "",
+ getSelectorName(PD->getGetterName()),
+ getSelectorName(PD->getSetterName()),
PD->getPropertyAttributes(),
getOrCreateType(PD->getType(),PUnit));
}
diff --git a/test/CodeGenObjC/debug-info-property3.m b/test/CodeGenObjC/debug-info-property3.m
index 804127d8c4..c3bf1ae262 100644
--- a/test/CodeGenObjC/debug-info-property3.m
+++ b/test/CodeGenObjC/debug-info-property3.m
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -S -emit-llvm -g %s -o - | FileCheck %s
-// CHECK: metadata !"p1", metadata !6, i32 5, metadata !"-[I1 p1]", metadata !"-[I1 setP1:]", i32 2316, metadata !9} ; [ DW_TAG_APPLE_property ]
+// CHECK: metadata !"p1", metadata !6, i32 5, metadata !"p1", metadata !"setP1:", i32 2316, metadata !9} ; [ DW_TAG_APPLE_property ]
@interface I1
@property int p1;
@end