LLVM

The LLVM compiler infrastructure project (formerly Low Level Virtual Machine) is a Compiler Infrastructure designed to be a set of reusable libraries with well-defined interfaces - wikipedia

LLVM can translate from any language supported by gcc 4.2.1 (Ada, C, C++, Fortran, Java, Objective-C, or Objective-C++) or by clang to any of: C, C++, or MSIL by way of the "arch" command in llvm-gcc.

llvm-g++ -emit-llvm x.cpp -o program.bc -c llc -march=c program.bc -o x.c cc x.c -lstdc++ llvm-g++ x.cpp -o program.bc -c llc -march=msil program.bc -o program.msil

Translation to C has been removed from LLVM since version 3.1. It had numerous problems, to the point of not being able to compile any nontrivial program.[26] Emscripten

#History

LLVM is written in C++ and is designed for compile-time, link-time, run-time, and "idle-time" optimization of programs written in arbitrary programming languages.

Originally implemented for C and C++, the language-agnostic design (and the success) of LLVM has since spawned a wide variety of front ends: languages with compilers that use LLVM include:

  • Common Lisp
  • ActionScript
  • Ada
  • D< LI> Fortran
  • OpenGL Shading Language
  • Go
  • Haskell
  • Java bytecode
  • Julia
  • Objective-C
  • Swift
  • Python
  • Ruby
  • Rust
  • Scala
  • C#
  • Lua

The LLVM project started in 2000 at the University of Illinois at Urbana–Champaign, under the direction of Vikram Adve and Chris Lattner. LLVM was originally developed as a research infrastructure to investigate dynamic compilation techniques for static and dynamic programming languages.

# See also