<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 6/27/16 6:00 AM, Abhishek Kumar via
llvm-dev wrote:<br>
</div>
<blockquote
cite="mid:CAEAgXqXb_nMrxFvMNGW5sAf4ok6O4XGeus0n2F48GWKNKOLREA@mail.gmail.com"
type="cite">
<meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>
<div>
<div>Hello<br>
</div>
I am writing a converter from llvm IR to some other
language. I need all the information in the IR and debug
meta-data because I need original line numbers and variable
names in code. Is there some API sort of thing to access
this data without parsing the llvm output?<br>
</div>
</div>
</div>
</blockquote>
<br>
Yes. LLVM contains libraries for reading LLVM bitcode into memory
and examining the results.<br>
<br>
The easiest method, in my opinion, is to write an LLVM pass to do
the conversion. Look at the "How to Write an LLVM Pass" document on
the LLVM web page (<a class="moz-txt-link-freetext" href="https://llvm.org/docs">https://llvm.org/docs</a>, I think). You should also
read the LLVM Programmer's Manual and the LLVM Language Reference
Manual so that you understand what constructs are in an LLVM Module.<br>
<br>
Regards,<br>
<br>
John Criswell<br>
<br>
<blockquote
cite="mid:CAEAgXqXb_nMrxFvMNGW5sAf4ok6O4XGeus0n2F48GWKNKOLREA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div><br>
</div>
Thanks<br>
</div>
Abhishek Kumar<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<br>
<p><br>
</p>
<pre class="moz-signature" cols="72">--
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
</body>
</html>