This commit adds a hook to the `ModuleEnvironment` trait to learn when a custom section in a wasm file is read. This hook can in theory be used to parse and handle custom sections as they appear in the wasm file without having to re-iterate over the wasm file after cranelift has already parsed the wasm file. The `translate_module` function is now less strict in that it doesn't require sections to be in a particular order, but it's figured that the wasm file is already validated elsewhere to verify the section order.
This crate performs the translation from a wasm module in binary format to the in-memory form of the Cranelift IR.
If you're looking for a complete WebAssembly implementation that uses this library, see Wasmtime.