<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div>Hi David,</div>
<div><br>
</div>
<div>Indeed, I built stock 3.5.1 LLVM+Clang and the problem went away.  Diffing the resulting IR I found that the clang I was using (stock Xcode 'Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)') was not including !llvm.module.flags with references
 to the DWARF and debug info versions.  When I manually added this to the output from the Xcode Clang the problem went away; so I think it's safe to assume that our compiler has the same problem as we are also not including the llvm.module.flags.  Thanks for
 pointing me in the right direction!</div>
<div><br>
</div>
<div>
<div><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" face="Calibri">Peter Zion</font></font></div>
<div><br>
</div>
</div>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Monday, February 2, 2015 at 6:53 PM<br>
<span style="font-weight:bold">To: </span>Peter Zion <<a href="mailto:peter.zion@fabricengine.com">peter.zion@fabricengine.com</a>>, LLVM Developers Mailing List <<a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [LLVMdev] Debug info not preserved by llvm-as (LLParser)?<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">(oops, dropped the ML by accident)</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Feb 2, 2015 at 3:53 PM, David Blaikie <span dir="ltr">
<<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote"><span class="">On Mon, Feb 2, 2015 at 3:46 PM, Peter Zion
<span dir="ltr"><<a href="mailto:Peter.Zion@fabricengine.com" target="_blank">Peter.Zion@fabricengine.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">Hi there,</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><br>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">If I run:</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><br>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">  clang -S -emit-llvm -o - -g test.c</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><br>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">for a trivial test.c I see debug info in the IR as expected.  However, if I run:</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><br>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">  clang -S -emit-llvm -o - -g test.c | llvm-as | llvm-dis</div>
</div>
</blockquote>
</span>
<div><br>
Are you using matching (built from the exact same revision) versions of clang, llvm-as, and llvm-dis?<br>
 </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="">
<div style="word-wrap:break-word">
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><br>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">the debug info is stripped.  Is this intentional?  If so, is there a way to force the debug metadata to make its way through the pipeline?  This is on either LLVM 3.5 or LLVM 3.4.</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><br>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">This has come up for me because I was hoping to provide IR in place of source code in a certain part of our application and while it works any unit tests that rely on debug info are
 broken.  Tracking down the issue let me to this.</div>
<span><font color="#888888">
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><br>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><span style="font-family:Calibri">Peter Zion</span></div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">
<div><br>
</div>
</div>
</font></span></div>
<br>
</span>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</span>
</body>
</html>