[cfe-commits] r129626 - in /cfe/trunk/lib/CodeGen: CGDebugInfo.cpp CGDebugInfo.h

Devang Patel dpatel at apple.com
Fri Apr 15 17:37:51 PDT 2011


Author: dpatel
Date: Fri Apr 15 19:37:51 2011
New Revision: 129626

URL: http://llvm.org/viewvc/llvm-project?rev=129626&view=rev
Log:
Emit proper selector name in debug info.

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
    cfe/trunk/lib/CodeGen/CGDebugInfo.h

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=129626&r1=129625&r2=129626&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Apr 15 19:37:51 2011
@@ -119,6 +119,17 @@
   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 @@
     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,

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=129626&r1=129625&r2=129626&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.h (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.h Fri Apr 15 19:37:51 2011
@@ -267,6 +267,10 @@
   /// 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);
 





More information about the cfe-commits mailing list