[LLVMdev] LLVM IR generation as one of LLVM passes

Wojciech Daniło wojtek.danilo.ml at gmail.com
Tue Nov 6 01:10:12 PST 2012


Thank you, I have seen this page, but before I start developing my tool and
digging deeply into LLVM I would love to know if I can generate LLVM IR in
one of passes (as a result of one pass, before running other).
Please answer this simple question :)

Thank you :)

2012/11/6 Eli Friedman <eli.friedman at gmail.com>

> On Mon, Nov 5, 2012 at 5:17 PM, Wojciech Daniło
> <wojtek.danilo.ml at gmail.com> wrote:
> > Hi!
> > I'm new to LLVM and I'm planning to write a compiler, which would behave
> > slighty different than all current tools.
> > As an input it will not get text but it will read a file (lets assume
> for a
> > moment, that in this file there will be a graph structure).
> > Before generating IR code I want to be able to run optimalization and
> > analysis passes on this graph and after these passes I want to run pass
> that
> > will generate LLVM IR on top of previously gathered informations.
> > Additional I want to be able to chose pass which will produce IR code (if
> > there will be more than one such pass).
> > Is it possible in LLVM? (can I generate IR inside a compilation pass and
> use
> > passes in described way?)
> >
> > If the above description will be not clear, concider following
> construction
> > (uppercase letters are passes and lowercase letters are data consumed and
> > produced by each pass respectlively)
> > A: file->b
> > B: b->c
> > C: b->d
> > I1: c -> IR
> > I2: d -> IR
> > ... (other LLVM passes)
> >
> > and now I could enable passes:
> > A,B and I1
> > or
> > A,C and I2
> >
> > (both of them generate IR code but differently).
> >
> > I would be very thankfull if something like that  could be done in LLVM
> and
> > if yes, any further materials will be very appreciated :)
> > Thank you!
>
> See http://llvm.org/docs/WritingAnLLVMPass.html for more info on passes.
>
> -Eli
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121106/a868f3a7/attachment.html>


More information about the llvm-dev mailing list