[llvm-dev] Parsing llvm IR
John Criswell via llvm-dev
llvm-dev at lists.llvm.org
Mon Jun 27 07:54:37 PDT 2016
On 6/27/16 6:00 AM, Abhishek Kumar via llvm-dev wrote:
> 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?
Yes. LLVM contains libraries for reading LLVM bitcode into memory and
examining the results.
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 (https://llvm.org/docs, 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.
> Abhishek Kumar
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
Department of Computer Science, University of Rochester
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev