Add minor documentation updates

This commit is contained in:
Mark McCaskey
2020-01-31 13:10:02 -08:00
parent a6c55ea548
commit 870c057826
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,8 @@
//! Code for dealing with LLVM and VM intrinsics.
//!
//! Intrinsics are built-in operations. LLVM intrinsics are used to precisely
//! compute values. VM intrinsics are used to interact with the host VM.
use inkwell::{ use inkwell::{
attributes::{Attribute, AttributeLoc}, attributes::{Attribute, AttributeLoc},
builder::Builder, builder::Builder,
@ -34,6 +39,7 @@ fn type_to_llvm_ptr<'ctx>(intrinsics: &Intrinsics<'ctx>, ty: Type) -> PointerTyp
} }
} }
/// Struct containing LLVM and VM intrinsics.
pub struct Intrinsics<'ctx> { pub struct Intrinsics<'ctx> {
pub ctlz_i32: FunctionValue<'ctx>, pub ctlz_i32: FunctionValue<'ctx>,
pub ctlz_i64: FunctionValue<'ctx>, pub ctlz_i64: FunctionValue<'ctx>,
@ -151,6 +157,7 @@ pub struct Intrinsics<'ctx> {
} }
impl<'ctx> Intrinsics<'ctx> { impl<'ctx> Intrinsics<'ctx> {
/// Create an [`Intrinsics`] for the given [`Context`].
pub fn declare(module: &Module<'ctx>, context: &'ctx Context) -> Self { pub fn declare(module: &Module<'ctx>, context: &'ctx Context) -> Self {
let void_ty = context.void_type(); let void_ty = context.void_type();
let i1_ty = context.bool_type(); let i1_ty = context.bool_type();

View File

@ -78,7 +78,7 @@
//! //!
//! # Additional Notes: //! # Additional Notes:
//! //!
//! The `wasmer-runtime` is build to support compiler multiple backends. //! `wasmer-runtime` is built to support multiple compiler backends.
//! Currently, we support the Singlepass, [Cranelift], and LLVM compilers //! Currently, we support the Singlepass, [Cranelift], and LLVM compilers
//! with the [`wasmer-singlepass-backend`], [`wasmer-clif-backend`], and //! with the [`wasmer-singlepass-backend`], [`wasmer-clif-backend`], and
//! wasmer-llvm-backend crates, respectively. //! wasmer-llvm-backend crates, respectively.
@ -145,7 +145,7 @@ pub mod units {
} }
pub mod types { pub mod types {
//! Various types. //! Types used in the Wasm runtime and conversion functions.
pub use wasmer_runtime_core::types::*; pub use wasmer_runtime_core::types::*;
} }