[llvm-dev] How to avoid or remove llvm.dbg.value?

296 views
Skip to first unread message

Alberto Barbaro via llvm-dev

unread,
Nov 8, 2019, 9:59:17 AM11/8/19
to llvm-dev
Hi all,
Is there any way for avoiding to use llvm.dbg.value within a bc file? If not, once I have the bc how can I remove all the occurrences? 

Thanks

Tim Northover via llvm-dev

unread,
Nov 8, 2019, 10:05:40 AM11/8/19
to Alberto Barbaro, llvm-dev
Hi Alberto,

On Fri, 8 Nov 2019 at 06:59, Alberto Barbaro via llvm-dev
<llvm...@lists.llvm.org> wrote:
> Is there any way for avoiding to use llvm.dbg.value within a bc file?

They're part of LLVM's representation of debugging information (as you
may have guessed). So if compiling with Clang you can just not pass -g
and you won't get any (or override with -g0 if your build system
already adds -g and it's inconvenient to avoid that). Other front-ends
will have similar options I expect.

> If not, once I have the bc how can I remove all the occurrences?

You can run "opt -strip-debug" will remove it in that situation.

Cheers.

Tim.
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

Alberto Barbaro via llvm-dev

unread,
Nov 8, 2019, 10:13:20 AM11/8/19
to Tim Northover, llvm-dev
Hi Tim,
Thank you very much for the message. It indeed solved the problem.

Thanks

Robinson, Paul via llvm-dev

unread,
Nov 12, 2019, 12:43:28 PM11/12/19
to Alberto Barbaro, Tim Northover, llvm...@lists.llvm.org

If you are writing a pass and don’t want to bother with debug-info instructions at first, that’s fine; but note that the pass will have to contend with the debug-info instructions at some point, or your pass is likely to behave differently for code compiled with -g which is a Bad Thing.

--paulr

Alberto Barbaro via llvm-dev

unread,
Nov 22, 2019, 3:09:49 PM11/22/19
to Robinson, Paul, llvm-dev
Thanks Paul for the info. For now I'm happy without them

Alberto
Reply all
Reply to author
Forward
0 new messages