Hi There, I've just started reading about LLVM and I just wanted to make sure that it can do what I was hoping it could do. Am I correct in assuming that I could use LLVM as a backend for a compiler, emiting LLVM byte codes which could either be natively compiled (Sparc and x86) or byte code interpretted / JITed??
Yes, that's right! In fact, shortly the process of doing that will get easier with the llvmc (compiler driver) tool that I'm working on. You write your compiler to generate either bytecode or LLVM assembly and a configuration file. The rest of it (optimization, linking, codegen) can be done with existing LLVM tools. If you later want to include those features in your compiler, you can (via the C++ interface) and just reconfigure your compiler's configuration file. Welcome to LLVM, Peter! Reid. On Wed, 2004-08-18 at 15:13, Peter Ashford wrote:> Hi There, > > I've just started reading about LLVM and I just wanted to make sure that > it can do what I was hoping it could do. Am I correct in assuming that > I could use LLVM as a backend for a compiler, emiting LLVM byte codes > which could either be natively compiled (Sparc and x86) or byte code > interpretted / JITed?? > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040818/207865d4/attachment.sig>
On Thu, Aug 19, 2004 at 10:13:36AM +1200, Peter Ashford wrote:> I've just started reading about LLVM and I just wanted to make sure > that it can do what I was hoping it could do. Am I correct in > assuming that I could use LLVM as a backend for a compiler, emiting > LLVM byte codes which could either be natively compiled (Sparc and > x86) or byte code interpretted / JITed??That is correct. You can write your own front-end or use our C/C++ front end to emit LLVM bytecode, and then our tools (llc, static compiler, or lli, interpreter/jit) can generate native code from the LLVM. -- Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu
Reid Spencer wrote:>Yes, that's right! > >In fact, shortly the process of doing that will get easier with the >llvmc (compiler driver) tool that I'm working on. You write your >compiler to generate either bytecode or LLVM assembly and a > >Does that mean the front end must decide between emiting bytecode for interpretting/JITing and LLVM assembly for native compilation? You can't emit the one kind of output for either end target (interpretted bytecode or native compilation)?>configuration file. The rest of it (optimization, linking, codegen) can >be done with existing LLVM tools. If you later want to include those >features in your compiler, you can (via the C++ interface) and just >reconfigure your compiler's configuration file. > >Welcome to LLVM, Peter! > >Thanks :o)
Reid Spencer wrote:> Yes, that's right! > > In fact, shortly the process of doing that will get easier with the > llvmc (compiler driver) tool that I'm working on.[another newbie delurks] Hi, Reid. Been tinkering with LLVM about 2 weeks now. I've been using the Stacker Compiler as an example so far for my own little project. Is this tool you mentioned coming "Real Soon Now(tm)", or is it months away? If its coming soon, should I avoid using the Stacker example as a template? In other words, how much is this tool going to change the way one builds a frontend to LLVM? Sorry in advance if this is a stupid question, LLVM is still a new beast to me. Thanks folks for your effort here, after looking at GCC sources to see what writing a frontend would be like, LLVM looks like manna from heaven. Oh wait, that would make you guys.... uhh.... never mind. Ed