How to avoid or remove llvm.dbg.value?

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

Hi Alberto,

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.

Hi Tim,
Thank you very much for the message. It indeed solved the problem.

Thanks

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

Thanks Paul for the info. For now I’m happy without them

Alberto