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).<div>Please answer this simple question :)</div>
<div><br></div><div>Thank you :)<br><div><br><div class="gmail_quote">2012/11/6 Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Mon, Nov 5, 2012 at 5:17 PM, Wojciech Daniło<br>
<<a href="mailto:wojtek.danilo.ml@gmail.com">wojtek.danilo.ml@gmail.com</a>> wrote:<br>
> Hi!<br>
> I'm new to LLVM and I'm planning to write a compiler, which would behave<br>
> slighty different than all current tools.<br>
> As an input it will not get text but it will read a file (lets assume for a<br>
> moment, that in this file there will be a graph structure).<br>
> Before generating IR code I want to be able to run optimalization and<br>
> analysis passes on this graph and after these passes I want to run pass that<br>
> will generate LLVM IR on top of previously gathered informations.<br>
> Additional I want to be able to chose pass which will produce IR code (if<br>
> there will be more than one such pass).<br>
> Is it possible in LLVM? (can I generate IR inside a compilation pass and use<br>
> passes in described way?)<br>
><br>
> If the above description will be not clear, concider following construction<br>
> (uppercase letters are passes and lowercase letters are data consumed and<br>
> produced by each pass respectlively)<br>
> A: file->b<br>
> B: b->c<br>
> C: b->d<br>
> I1: c -> IR<br>
> I2: d -> IR<br>
> ... (other LLVM passes)<br>
><br>
> and now I could enable passes:<br>
> A,B and I1<br>
> or<br>
> A,C and I2<br>
><br>
> (both of them generate IR code but differently).<br>
><br>
> I would be very thankfull if something like that  could be done in LLVM and<br>
> if yes, any further materials will be very appreciated :)<br>
> Thank you!<br>
<br>
</div></div>See <a href="http://llvm.org/docs/WritingAnLLVMPass.html" target="_blank">http://llvm.org/docs/WritingAnLLVMPass.html</a> for more info on passes.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Eli<br>
</font></span></blockquote></div><br></div></div>