Fix cg_gcc merge

This commit is contained in:
Guillaume Gomez 2024-03-09 18:21:13 +01:00
parent 2b5b43eeb9
commit 1d058a0b06

View File

@ -114,7 +114,8 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
options: InlineAsmOptions, options: InlineAsmOptions,
span: &[Span], span: &[Span],
instance: Instance<'_>, instance: Instance<'_>,
_catch_funclet: Option<(Self::BasicBlock, Self::BasicBlock, Option<&Self::Funclet>)>, dest: Option<Self::BasicBlock>,
_catch_funclet: Option<(Self::BasicBlock, Option<&Self::Funclet>)>,
) { ) {
if options.contains(InlineAsmOptions::MAY_UNWIND) { if options.contains(InlineAsmOptions::MAY_UNWIND) {
self.sess().dcx().create_err(UnwindingInlineAsm { span: span[0] }).emit(); self.sess().dcx().create_err(UnwindingInlineAsm { span: span[0] }).emit();
@ -537,8 +538,9 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
} }
if dest.is_none() && options.contains(InlineAsmOptions::NORETURN) { if dest.is_none() && options.contains(InlineAsmOptions::NORETURN) {
let builtin_unreachable = self.context.get_builtin_function("__builtin_unreachable"); let builtin_unreachable = self.context.get_builtin_function("__builtin_unreachable");
let builtin_unreachable: RValue<'gcc> = let builtin_unreachable: RValue<'gcc> = unsafe {
unsafe { std::mem::transmute(builtin_unreachable) }; std::mem::transmute(builtin_unreachable)
};
self.call(self.type_void(), None, None, builtin_unreachable, &[], None); self.call(self.type_void(), None, None, builtin_unreachable, &[], None);
} }