wasmer/lib/llvm-backend/src/read_info.rs

18 lines
591 B
Rust
Raw Normal View History

use crate::code::CodegenError;
use wasmer_runtime_core::parse::wp_type_to_type;
2019-05-06 23:41:31 -05:00
use wasmer_runtime_core::types::Type;
use wasmparser::TypeOrFuncType as WpTypeOrFuncType;
2019-07-01 16:11:38 -07:00
pub fn blocktype_to_type(ty: WpTypeOrFuncType) -> Result<Type, CodegenError> {
2019-07-01 16:11:38 -07:00
match ty {
WpTypeOrFuncType::Type(inner_ty) => Ok(wp_type_to_type(inner_ty)?),
2019-07-01 16:11:38 -07:00
_ => {
return Err(CodegenError {
2019-07-01 16:15:13 -07:00
message:
"the wasmer llvm backend does not yet support the multi-value return extension"
.to_string(),
2019-07-01 16:11:38 -07:00
});
}
}
}