<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 2, 2010, at 10:45 AM, David Chisnall wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Verdana; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">On 2 Sep 2010, at 18:31, Devang Patel wrote:<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">On Sep 2, 2010, at 10:16 AM, David Chisnall wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">Author: theraven<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Date: Thu Sep  2 12:16:32 2010<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">New Revision: 112833<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=112833&view=rev">http://llvm.org/viewvc/llvm-project?rev=112833&view=rev</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Log:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">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.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">test case ?<br></blockquote><br>I'm not sure what the test case would test.<br></span></blockquote><div><br></div>The patch would change something in generated LLVM IR.<br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Verdana; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><br><blockquote type="cite"><blockquote type="cite">Modified:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=112833&r1=112832&r2=112833&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=112833&r1=112832&r2=112833&view=diff</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">==============================================================================<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Sep  2 12:16:32 2010<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">@@ -1471,6 +1471,20 @@<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">  Name = getFunctionName(FD);<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">  // Use mangled name as linkage name for c/c++ functions.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">  LinkageName = CGM.getMangledName(GD);<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+  } else if (const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D)) {<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+    llvm::SmallString<256> MethodName;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+    llvm::raw_svector_ostream OS(MethodName);<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+    OS << (OMD->isInstanceMethod() ? '-' : '+') << '[';<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+    const DeclContext *DC = OMD->getDeclContext();<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+    if (const ObjCImplementationDecl *OID = dyn_cast<const ObjCImplementationDecl>(DC)) {<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+       OS << OID->getName();<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+    } else if (const ObjCCategoryImplDecl *OCD = dyn_cast<const ObjCCategoryImplDecl>(DC)){<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+        OS << ((NamedDecl *)OCD)->getIdentifier()->getNameStart() << '(' <<<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+            OCD->getIdentifier()->getNameStart() << ')';<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+    }<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+    OS << ' ' << OMD->getSelector().getAsString() << ']';<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+    Name = MethodName;<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Isn't this means Name will reference local SmallString MethodName outside MethodName's scope ?<br></blockquote><br>Could be.  I'm not entirely clear about how LLVM's string stuff works - I assumed it was a copy that was optimised away - if so moving the MethodName declaration outside the block should fix it.<br></span></blockquote><br></div><div>See getFunctionName() implementation.</div><div><br></div><div>-</div><div>Devang</div><br></body></html>