diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-11-11 19:43:42 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-11-12 17:10:46 +0000 |
| commit | 794707078987ceb9e72cb22820e1c818fd6c212e (patch) | |
| tree | 72ac42119eb66da2e4abff4a759908b23a9a1688 | |
| parent | ede3269ed80ebf60e8c996396ce3231e6ba4ebbd (diff) | |
| download | rust-794707078987ceb9e72cb22820e1c818fd6c212e.tar.gz rust-794707078987ceb9e72cb22820e1c818fd6c212e.zip | |
Minor changes to codegen_inline_asm_terminator
| -rw-r--r-- | src/base.rs | 2 | ||||
| -rw-r--r-- | src/inline_asm.rs | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/base.rs b/src/base.rs index 91b1547cb6e..71557d49ef2 100644 --- a/src/base.rs +++ b/src/base.rs @@ -456,7 +456,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) { ); } - crate::inline_asm::codegen_inline_asm( + crate::inline_asm::codegen_inline_asm_terminator( fx, source_info.span, template, diff --git a/src/inline_asm.rs b/src/inline_asm.rs index ce0eecca8a8..0159ec5db9e 100644 --- a/src/inline_asm.rs +++ b/src/inline_asm.rs @@ -34,7 +34,7 @@ enum CInlineAsmOperand<'tcx> { }, } -pub(crate) fn codegen_inline_asm<'tcx>( +pub(crate) fn codegen_inline_asm_terminator<'tcx>( fx: &mut FunctionCx<'_, '_, 'tcx>, span: Span, template: &[InlineAsmTemplatePiece], @@ -135,9 +135,6 @@ pub(crate) fn codegen_inline_asm<'tcx>( }) .collect::<Vec<_>>(); - let mut inputs = Vec::new(); - let mut outputs = Vec::new(); - let mut asm_gen = InlineAssemblyGenerator { tcx: fx.tcx, arch: fx.tcx.sess.asm_arch.unwrap(), @@ -165,6 +162,8 @@ pub(crate) fn codegen_inline_asm<'tcx>( let generated_asm = asm_gen.generate_asm_wrapper(&asm_name); fx.cx.global_asm.push_str(&generated_asm); + let mut inputs = Vec::new(); + let mut outputs = Vec::new(); for (i, operand) in operands.iter().enumerate() { match operand { CInlineAsmOperand::In { reg: _, value } => { |
