"puts",
Linkage::Import,
&Signature {
- call_conv: CallConv::SystemV,
+ call_conv: CallConv::triple_default(fx.triple()),
params: vec![AbiParam::new(pointer_ty(fx.tcx))],
returns: vec![],
},
let msg_id = fx
.module
.declare_data(
- &(symbol_name.as_str().to_string() + msg),
+ &(symbol_name.name.as_str().to_string() + msg),
Linkage::Local,
false,
None,
msg: impl AsRef<str>,
) -> CValue<'tcx> {
trap_unimplemented(fx, msg);
- let zero = fx.bcx.ins().iconst(fx.pointer_type, 0);
- CValue::by_ref(zero, dest_layout)
-}
-
-/// Like `trap_unreachable` but returns a fake place for the specified type.
-///
-/// Trap code: user65535
-pub fn trap_unreachable_ret_place<'tcx>(
- fx: &mut FunctionCx<'_, 'tcx, impl cranelift_module::Backend>,
- dest_layout: TyLayout<'tcx>,
- msg: impl AsRef<str>,
-) -> CPlace<'tcx> {
- trap_unimplemented(fx, msg);
- let zero = fx.bcx.ins().iconst(fx.pointer_type, 0);
- CPlace::for_addr(zero, dest_layout)
+ CValue::by_ref(Pointer::const_addr(fx, 0), dest_layout)
}