diff options
author | Devang Patel <dpatel@apple.com> | 2011-04-16 00:37:51 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-04-16 00:37:51 +0000 |
commit | 90c1eedd060b33946a0c3ed7d25b6ae435c4aac9 (patch) | |
tree | 5119859163181d1673f524ea3deaa8aef32a21ab | |
parent | fa936d8304a014f0d0a8382183fb3370ced3bc0a (diff) |
Emit proper selector name in debug info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129626 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 15 | ||||
-rw-r--r-- | lib/CodeGen/CGDebugInfo.h | 4 |
2 files changed, 17 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 542fba29b9..9743b96b40 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -119,6 +119,17 @@ llvm::StringRef CGDebugInfo::getObjCMethodName(const ObjCMethodDecl *OMD) { return llvm::StringRef(StrPtr, OS.tell()); } +/// getSelectporName - Return selector name. This is used for debugging +/// info. +llvm::StringRef CGDebugInfo::getSelectorName(Selector S) { + llvm::SmallString<256> SName; + llvm::raw_svector_ostream OS(SName); + OS << S.getAsString(); + char *StrPtr = DebugInfoNames.Allocate<char>(OS.tell()); + memcpy(StrPtr, SName.begin(), OS.tell()); + return llvm::StringRef(StrPtr, OS.tell()); +} + /// getClassName - Get class name including template argument list. llvm::StringRef CGDebugInfo::getClassName(RecordDecl *RD) { @@ -1198,8 +1209,8 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty, if (ObjCPropertyDecl *PD = ID->FindPropertyVisibleInPrimaryClass(Field->getIdentifier())) { PropertyName = PD->getName(); - PropertyGetter = PD->getGetterName().getNameForSlot(0); - PropertySetter = PD->getSetterName().getNameForSlot(0); + PropertyGetter = getSelectorName(PD->getGetterName()); + PropertySetter = getSelectorName(PD->getSetterName()); PropertyAttributes = PD->getPropertyAttributes(); } FieldTy = DBuilder.createObjCIVar(FieldName, FieldDefUnit, diff --git a/lib/CodeGen/CGDebugInfo.h b/lib/CodeGen/CGDebugInfo.h index fbe4c1d2c0..f658ea63ac 100644 --- a/lib/CodeGen/CGDebugInfo.h +++ b/lib/CodeGen/CGDebugInfo.h @@ -267,6 +267,10 @@ private: /// This is the display name for the debugging info. llvm::StringRef getObjCMethodName(const ObjCMethodDecl *FD); + /// getSelectporName - Return selector name. This is used for debugging + /// info. + llvm::StringRef getSelectorName(Selector S); + /// getClassName - Get class name including template argument list. llvm::StringRef getClassName(RecordDecl *RD); |