Update to the next version of the witx crate

This commit updates to the 0.9 version of the witx crate implemented in
WebAssembly/wasi#395. This new version drastically changes code
generation and how we interface with the crate. The intention is to
abstract the code generation aspects and allow code generators to
implement much more low-level instructions to enable more flexible APIs
in the future. Additionally a bunch of `*.witx` files were updated in
the WASI repository.

It's worth pointing out, however, that `wasi-common` does not change as
a result of this change. The shape of the APIs that we need to implement
are effectively the same and the only difference is that the shim
functions generated by wiggle are a bit different.
This commit is contained in:
Alex Crichton
2021-02-11 09:28:36 -08:00
committed by Andrew Brown
parent aed6de32d4
commit df9c725fa0
24 changed files with 510 additions and 806 deletions

View File

@@ -6,11 +6,10 @@ mod module_trait;
mod names;
mod types;
use lifetimes::anon_lifetime;
use proc_macro2::TokenStream;
use quote::quote;
use lifetimes::anon_lifetime;
pub use config::Config;
pub use error_transform::{ErrorTransform, UserErrorType};
pub use funcs::define_func;
@@ -67,6 +66,8 @@ pub fn generate(doc: &witx::Document, names: &Names, errs: &ErrorTransform) -> T
quote!(
pub mod types {
use std::convert::TryFrom;
#(#types)*
#guest_error_conversion
#user_error_conversion