Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Clang is a parser for C-like languages including C++. If your language is C-like enough (ie., Java is not) then you could add support for your language to clang, which knows how to produce LLVM IR.</p> <p>LLVM does not require JIT, and is normally statically linked. LLVM provides libraries that perform optimization and code generation of LLVM IR. To JIT is just to generate code to memory instead of on disk. The ordinary usage of Clang+LLVM is as a drop-in replacement for GCC, generating code to .o files.</p> <p>How big it will be depends on what you need. Do you want all the optimizations? Do you want all the targets (unlike GCC, LLVM is can be built with as many backends in one binary as you want). Since you mentioned embedded, one example is Android using LLVM on cell phones: <a href="http://android-developers.blogspot.com/2011/02/introducing-renderscript.html">http://android-developers.blogspot.com/2011/02/introducing-renderscript.html</a></p> <p>Windows is supported rather well, you can build LLVM with MSVC++ using our CMake build system, or mingw32. Solaris support is more iffy, we periodically used to get patches to fix it up, but I haven't seen any for a while.</p> <p>Finally, you may want to read the tutorial at <a href="http://llvm.org/docs/tutorial">http://llvm.org/docs/tutorial</a> . This chronicles the construction of a JITted REPL language, but the basis is the same for a statically compiled language. Instead of using an llvm::JIT object, you call Target.addPassesToEmitFile and hand it the output stream to write to. See llvm/tools/llc/llc.cpp for a fully worked example (it's lengthy; only a small fraction of that is needed if you don't want to support all the options that llc does).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload