What is the size of the program using LLVM / CLANG for a custom bytecode virtual machine?

I evaluate various features for a virtual virtual machine, and I left LLVM from another question. Since I am still working on evaluating the built-in language VMs, I cannot verify / verify this myself yet. I would like to know the following information about LLVM / CLANG:

  • Is it supported on Windows? Or Solaris? (cross platform is a plus for me).
  • If I want to write my own / custom virtual machine with a C-like language, what do I need to include in the project? (Sections or components of LLVM / CLANG, etc.)
  • I would leave the compiler separate from VM for obvious reasons (I did not write a translator). What will be the size of the required components? Can I create them in a program instead of dynamically linking to them?
  • Can I Avoid JIT? I would like to have a VM bytecode that does not necessarily translate into native code. This will help when JIT is not supported on the platform (for example, systems with limited memory permissions that do not allow wx / rwx memory mapping).

I know that clamav antivirus, for example, uses bytecode supported by LLVM / clang to support dynamic / temporary signatures. However, I do not know if there is any means to implement this and / or a tutorial or documentation that will guide you through the process of implementing such a thing.

Thank!:)

+5
source share
1 answer

Clang - C- , ++. C- ( , Java ), clang, , LLVM IR.

LLVM JIT . LLVM , LLVM IR. JIT - , . Clang + LLVM GCC, .o.

, . ? , ( GCC, LLVM , ). , Android LLVM : http://android-developers.blogspot.com/2011/02/introducing-renderscript.html

Windows , LLVM MSV++ CMake mingw32. Solaris , , , - .

, http://llvm.org/docs/tutorial. JITted REPL, . llvm:: JIT Target.addPassesToEmitFile . . Llvm/tools/llc/llc.cpp ( , , , llc).

+5

All Articles