diff options
author | Eric Christopher <echristo@apple.com> | 2012-03-29 17:31:33 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2012-03-29 17:31:33 +0000 |
commit | bd9c910c8c0e30d646c2e1a052297df2032117cb (patch) | |
tree | ccd369631c29f1baad27aeb9c2b26c3e2da8b750 /clang/lib/CodeGen | |
parent | 5d2b8d904261ca8d49035faed3f71bebc599850d (diff) | |
download | bcm5719-llvm-bd9c910c8c0e30d646c2e1a052297df2032117cb.tar.gz bcm5719-llvm-bd9c910c8c0e30d646c2e1a052297df2032117cb.zip |
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
llvm-svn: 153659
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index fa26d4706d6..af55a86a590 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/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)); } |