numba/numba — pull request #684 by sklam (2014-08-07 15:12:08+00:00)
Title: [WIP] a lightweight LLVM binding

Switch to `llvmlite` for a lightweight LLVM-python binding. Old `llvmpy` binding exposes a lot of LLVM but the mapping C++ to python style memory management is error prone. Numba and many JIT compiler does not need a full LLVM API. Only the IR builder, optimizer, and JIT compiler APIs are necessary.

Key benefits:
- llvmlite memory management is explicit `obj.close()` or with-context
- llvmlite IR builder is pure python
- llvmlite uses LLVM assembly parser which provide better error messages (no more segfault due to bad IR construction)
- Most of llvmlite uses the LLVM C API which is small but very stable and backward compatible (low maintenance when changing LLVM version)
- The binding in llvmlite is optional (only if you are using `llvmlite.binding`)
- The binding is not a python C-extension (no need to wrestle with Python's compiler requirement and C++11 compatibility)
- `llvmlite` is more 1.5x faster in early benchmark (compiling numba.tests.usecases.andor)