Skip to content

Commit d120988

Browse files
committed
Add some missing doc comments I found helpful.
1 parent bf8ddbe commit d120988

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

crates/cranelift/src/func_environ.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ impl<'module_environment> FuncEnvironment<'module_environment> {
231231
self.isa.pointer_type()
232232
}
233233

234+
/// Retrieves the VMContext, creating it first if necessary.
234235
pub(crate) fn vmctx(&mut self, func: &mut Function) -> ir::GlobalValue {
235236
self.vmctx.unwrap_or_else(|| {
236237
let vmctx = func.create_global_value(ir::GlobalValueData::VMContext);
@@ -257,6 +258,7 @@ impl<'module_environment> FuncEnvironment<'module_environment> {
257258
})
258259
}
259260

261+
/// Codegens a reference to the VMContext, and return it as well.
260262
pub(crate) fn vmctx_val(&mut self, pos: &mut FuncCursor<'_>) -> ir::Value {
261263
let pointer_type = self.pointer_type();
262264
let vmctx = self.vmctx(&mut pos.func);
@@ -327,7 +329,7 @@ impl<'module_environment> FuncEnvironment<'module_environment> {
327329
ptr
328330
}
329331

330-
/// Get the `*mut VMStoreContext` value for our `VMContext`.
332+
/// Codegens and returns the `*mut VMStoreContext` value for our `VMContext`.
331333
fn get_vmstore_context_ptr(&mut self, builder: &mut FunctionBuilder) -> ir::Value {
332334
let global = self.get_vmstore_context_ptr_global(&mut builder.func);
333335
builder.ins().global_value(self.pointer_type(), global)

0 commit comments

Comments
 (0)