}
}
- fn codegen_return_terminator<'b>(
- &mut self,
- mut bx: Bx,
- ) {
+ fn codegen_return_terminator(&mut self, mut bx: Bx) {
if self.fn_ty.c_variadic {
match self.va_list_ref {
Some(va_list) => {
bx.range_metadata(llval, 0..2);
}
}
- // We store bools as i8 so we need to truncate to i1.
+ // We store bools as `i8` so we need to truncate to `i1`.
llval = base::to_immediate(bx, llval, arg.layout);
}
}
fn_ret: &ArgType<'tcx, Ty<'tcx>>,
llargs: &mut Vec<Bx::Value>, is_intrinsic: bool
) -> ReturnDest<'tcx, Bx::Value> {
- // If the return is ignored, we can just return a do-nothing ReturnDest
+ // If the return is ignored, we can just return a do-nothing `ReturnDest`.
if fn_ret.is_ignore() {
return ReturnDest::Nothing;
}
LocalRef::Place(dest) => dest,
LocalRef::UnsizedPlace(_) => bug!("return type must be sized"),
LocalRef::Operand(None) => {
- // Handle temporary places, specifically Operand ones, as
- // they don't have allocas
+ // Handle temporary places, specifically `Operand` ones, as
+ // they don't have `alloca`s.
return if fn_ret.is_indirect() {
// Odd, but possible, case, we have an operand temporary,
// but the calling convention has an indirect return.
ReturnDest::IndirectOperand(tmp, index)
} else if is_intrinsic {
// Currently, intrinsics always need a location to store
- // the result. so we create a temporary alloca for the
- // result
+ // the result, so we create a temporary `alloca` for the
+ // result.
let tmp = PlaceRef::alloca(bx, fn_ret.layout, "tmp_ret");
tmp.storage_live(bx);
ReturnDest::IndirectOperand(tmp, index)
if dest.align < dest.layout.align.abi {
// Currently, MIR code generation does not create calls
// that store directly to fields of packed structs (in
- // fact, the calls it creates write only to temps),
+ // fact, the calls it creates write only to temps).
//
// If someone changes that, please update this code path
// to create a temporary.
}
enum ReturnDest<'tcx, V> {
- // Do nothing, the return value is indirect or ignored
+ // Do nothing; the return value is indirect or ignored.
Nothing,
- // Store the return value to the pointer
+ // Store the return value to the pointer.
Store(PlaceRef<'tcx, V>),
- // Stores an indirect return value to an operand local place
+ // Store an indirect return value to an operand local place.
IndirectOperand(PlaceRef<'tcx, V>, mir::Local),
- // Stores a direct return value to an operand local place
+ // Store a direct return value to an operand local place.
DirectOperand(mir::Local)
}