From afb25fd98a53e5bbd522c804c79c0fa854d93729 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Tue, 16 Jul 2024 19:48:00 +0800 Subject: [PATCH] Codegen C - Handle a new intrinsic for 1.74 --- src/trans/codegen_c.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp index cba622e06..e37ae82f8 100644 --- a/src/trans/codegen_c.cpp +++ b/src/trans/codegen_c.cpp @@ -7057,6 +7057,10 @@ namespace { MIR_BUG(mir_res, "Unknown atomic intrinsic '" << name << "'"); } } + else if( name == "option_payload_ptr" ) { // 1.74 only, removed later + // Converts `*const Option` to `*const T`, even if `None` + emit_lvalue(e.ret_val); m_of << " = &("; emit_param(e.args.at(0)); m_of << ")->DATA.var_1. _0"; + } // -- stdarg -- else if( name == "va_copy" ) { m_of << "va_copy( *(va_list*)&"; emit_param(e.args.at(0)); m_of << ", *(va_list*)&"; emit_param(e.args.at(1)); m_of << ")";