<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=ks_c_5601-1987"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:"¸¼Àº °íµñ";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
        {font-family:"\@¸¼Àº °íµñ";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        text-autospace:none;
        word-break:break-hangul;
        font-size:10.0pt;
        font-family:"¸¼Àº °íµñ";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"¸¼Àº °íµñ";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:3.0cm 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=KO link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US>When linking .ll files with llvm-link or llvm-ld, the debug information is corrupted. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>As my investigation, alloca instruction, used to hold the debug information, nullifies the debug meta information <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>The attachments is the patch for it. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Index: lib/Transforms/Utils/ValueMapper.cpp<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>===================================================================<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>--- lib/Transforms/Utils/ValueMapper.cpp        (revision 157974)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>+++ lib/Transforms/Utils/ValueMapper.cpp        (working copy)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>@@ -85,6 +85,10 @@<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>     // No operands needed remapping.  Use an identity mapping.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>     return const_cast<Value*>(V);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>   }<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>+<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>+  // Alloca instruction is used to identify the holding information in llvm.dbg.declare<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>+  if (isa<AllocaInst>(V))<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>+    return const_cast<Value*>(V);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>   // Okay, this either must be a constant (which may or may not be mappable) or<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>   // is something that is not in the mapping table.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Sincerely yours,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Jaemin Park<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>