CodeGen: LLVM wrapper for just-in-time code generation and compilation
The general template that for CodeGen use looks as follows:
The code above compiles a function that returns an integer that was passed to it as an argument incremented by one. The human-readable source code that CodeGen generates looks like this:
Since CodeGen takes care of emitting all necessary debugging information, and informing GDB about the JIT-ed functions, the debugging experience shouldn’t be too bad:
A more complicated example would be if one of the tuple elements was an ASCII string. For example, if for a value and arrays and we wanted to compute it could be achieved by the code like this:
CodeGen configures LLVM so that it takes advantage of the features available on the CPU it executes on.
Source: github.com