Files
wasmer/lib/compiler-llvm
Midas Lambrichts 15da6e8ce0 Added the 32 bit variant of x86 to generate a target machine for inkwell
Extended the match on X86_64 to include the X86_32 and all of its
architectures.
2021-06-20 21:01:38 +02:00
..
2021-06-15 11:26:46 -07:00

wasmer-compiler-llvm Build Status Join Wasmer Slack MIT License crates.io

This crate contains a compiler implementation based on the LLVM Compiler Infrastructure.

Usage

use wasmer::{Store, Universal};
use wasmer_compiler_llvm::LLVM;

let compiler = LLVM::new();
// Put it into an engine and add it to the store
let store = Store::new(&Universal::new(compiler).engine());

Note: you can find a full working example using LLVM compiler here.

When to use LLVM

We recommend using LLVM as the default compiler when running WebAssembly files on any production system, as it offers maximum peformance near to native speeds.

Requirements

The LLVM compiler requires a valid installation of LLVM in your system. It currently requires LLVM 10.

You can install LLVM easily on your Debian-like system via this command:

bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"

Or in macOS:

brew install llvm

Or via any of the pre-built binaries that LLVM offers.