[LLVMdev] Debug info not preserved by llvm-as (LLParser)?

Peter Zion Peter.Zion at fabricengine.com
Mon Feb 2 17:04:38 PST 2015


Hi David,

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!

Peter Zion

From: David Blaikie <dblaikie at gmail.com<mailto:dblaikie at gmail.com>>
Date: Monday, February 2, 2015 at 6:53 PM
To: Peter Zion <peter.zion at fabricengine.com<mailto:peter.zion at fabricengine.com>>, LLVM Developers Mailing List <llvmdev at cs.uiuc.edu<mailto:llvmdev at cs.uiuc.edu>>
Subject: Re: [LLVMdev] Debug info not preserved by llvm-as (LLParser)?

(oops, dropped the ML by accident)

On Mon, Feb 2, 2015 at 3:53 PM, David Blaikie <dblaikie at gmail.com<mailto:dblaikie at gmail.com>> wrote:


On Mon, Feb 2, 2015 at 3:46 PM, Peter Zion <Peter.Zion at fabricengine.com<mailto:Peter.Zion at fabricengine.com>> wrote:
Hi there,

If I run:

  clang -S -emit-llvm -o - -g test.c

for a trivial test.c I see debug info in the IR as expected.  However, if I run:

  clang -S -emit-llvm -o - -g test.c | llvm-as | llvm-dis

Are you using matching (built from the exact same revision) versions of clang, llvm-as, and llvm-dis?


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.

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.

Peter Zion


_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu<mailto:LLVMdev at cs.uiuc.edu>         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150203/0784bb22/attachment.html>


More information about the llvm-dev mailing list