Finding line numbers in source code associated with given bitcode instructions

Hello,

Is it possible to somehow similar to how DWARF functions with assembly find out which line numbers in unoptimized code are associated with which bitcode instructions for the purpose of debugging compiler passes? I am curious about whether this is possible prior to writing some instrumentation passes for the purpose of debugging them.

Thanks in advance,

Carter.

It looks like using one of clang’s -Rpass remark options would annotate instructions with source locations, without actually producing any debug info (type info etc). If that doesn’t work, -gmlt (aka -gline-tables-only) should do the trick.

–paulr

Great, thanks for the info!