From d3099a40c77b7782b031d05c60d595a236306dba Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Tue, 26 Jul 2022 16:26:35 +0000 Subject: [PATCH] Outline a bug! invocation This reduces the amount of llvm ir lines for intrinsic related code from 23801 to 20478. --- src/intrinsics/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs index 49c0fa34340..b2a83e1d4eb 100644 --- a/src/intrinsics/mod.rs +++ b/src/intrinsics/mod.rs @@ -7,7 +7,7 @@ macro_rules! intrinsic_args { let ($($arg),*) = if let [$($arg),*] = $args { ($(codegen_operand($fx, $arg)),*) } else { - bug!("wrong number of args for intrinsic {}", $intrinsic); + $crate::intrinsics::bug_on_incorrect_arg_count($intrinsic); }; } } @@ -26,6 +26,10 @@ macro_rules! intrinsic_args { use crate::prelude::*; use cranelift_codegen::ir::AtomicRmwOp; +fn bug_on_incorrect_arg_count(intrinsic: impl std::fmt::Display) -> ! { + bug!("wrong number of args for intrinsic {}", intrinsic); +} + fn report_atomic_type_validation_error<'tcx>( fx: &mut FunctionCx<'_, '_, 'tcx>, intrinsic: Symbol,