[llvm-dev] IR -> source pretty printing?

Eli Friedman via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 13 10:54:41 PDT 2016


On Wed, Jul 13, 2016 at 7:00 AM, Stephen Thomas via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi,
>
> I often find myself staring at IR and wanting to look at the C source code
> it corresponds to. To do so, I look up the debug identifier for the given
> IR line, scroll to the bottom of the IR file to find the debug identifier,
> look at the debug location (source and column), and then look at the source
> file. Too many steps. What would be great is a tool that took two files,
> i.e., a .c file and a .bc file, and printed out the IR with the
> corresponding C source right beneath each IR line.
>
> It wouldn't be too hard for me to write such a tool, but I thought I'd
> check to see if something already exists before I reinvent the wheel. Is
> there anything out there?
>
>
>
llvm-dis has a -show-annotations option; not precisely what you're looking
for, but it does print the line numbers inline.

-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160713/fdbf186d/attachment.html>


More information about the llvm-dev mailing list