[cfe-commits] r112833 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
David Chisnall
csdavec at swan.ac.uk
Thu Sep 2 10:16:32 PDT 2010
Author: theraven
Date: Thu Sep 2 12:16:32 2010
New Revision: 112833
URL: http://llvm.org/viewvc/llvm-project?rev=112833&view=rev
Log:
Use the unmangled name for the display name in Objective-C debug info. This should have no effect with the Mac runtime where clang (unlike GCC) uses the display name symbol name.
Modified:
cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=112833&r1=112832&r2=112833&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Sep 2 12:16:32 2010
@@ -1471,6 +1471,20 @@
Name = getFunctionName(FD);
// Use mangled name as linkage name for c/c++ functions.
LinkageName = CGM.getMangledName(GD);
+ } else if (const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D)) {
+ llvm::SmallString<256> MethodName;
+ llvm::raw_svector_ostream OS(MethodName);
+ OS << (OMD->isInstanceMethod() ? '-' : '+') << '[';
+ const DeclContext *DC = OMD->getDeclContext();
+ if (const ObjCImplementationDecl *OID = dyn_cast<const ObjCImplementationDecl>(DC)) {
+ OS << OID->getName();
+ } else if (const ObjCCategoryImplDecl *OCD = dyn_cast<const ObjCCategoryImplDecl>(DC)){
+ OS << ((NamedDecl *)OCD)->getIdentifier()->getNameStart() << '(' <<
+ OCD->getIdentifier()->getNameStart() << ')';
+ }
+ OS << ' ' << OMD->getSelector().getAsString() << ']';
+ Name = MethodName;
+ LinkageName = Name;
} else {
// Use llvm function name as linkage name.
Name = Fn->getName();
More information about the cfe-commits
mailing list