[cfe-commits] r112833 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Devang Patel dpatel at apple.com
Thu Sep 2 10:31:40 PDT 2010


On Sep 2, 2010, at 10:16 AM, David Chisnall wrote:

> 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.
> 

test case ?

> 
> 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;

Isn't this means Name will reference local SmallString MethodName outside MethodName's scope ?

Please use separate function here and if you need special treatment for GNU runtime then the code path should not be run for NEXT runtime.

-
Devang

> +    LinkageName = Name;
>   } else {
>     // Use llvm function name as linkage name.
>     Name = Fn->getName();
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list