Skip to content

Commit 283e2cf

Browse files
authored
Rollup merge of #134232 - bjorn3:naked_asm_improvements, r=wesleywiser
Share the naked asm impl between cg_ssa and cg_clif This was introduced in rust-lang/rust#128004.
2 parents d62fe1e + 25df5d0 commit 283e2cf

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/asm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl
829829

830830
impl<'gcc, 'tcx> AsmCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
831831
fn codegen_global_asm(
832-
&self,
832+
&mut self,
833833
template: &[InlineAsmTemplatePiece],
834834
operands: &[GlobalAsmOperandRef<'tcx>],
835835
options: InlineAsmOptions,

src/base.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ pub fn compile_codegen_unit(
206206
let f128_type_supported = target_info.supports_target_dependent_type(CType::Float128);
207207
let u128_type_supported = target_info.supports_target_dependent_type(CType::UInt128t);
208208
// TODO: improve this to avoid passing that many arguments.
209-
let cx = CodegenCx::new(
209+
let mut cx = CodegenCx::new(
210210
&context,
211211
cgu,
212212
tcx,
@@ -223,8 +223,8 @@ pub fn compile_codegen_unit(
223223
}
224224

225225
// ... and now that we have everything pre-defined, fill out those definitions.
226-
for &(mono_item, _) in &mono_items {
227-
mono_item.define::<Builder<'_, '_, '_>>(&cx);
226+
for &(mono_item, item_data) in &mono_items {
227+
mono_item.define::<Builder<'_, '_, '_>>(&mut cx, item_data);
228228
}
229229

230230
// If this codegen unit contains the main function, also create the

src/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ enum ExtremumOperation {
4545
Min,
4646
}
4747

48-
pub struct Builder<'a: 'gcc, 'gcc, 'tcx> {
48+
pub struct Builder<'a, 'gcc, 'tcx> {
4949
pub cx: &'a CodegenCx<'gcc, 'tcx>,
5050
pub block: Block<'gcc>,
5151
pub location: Option<Location<'gcc>>,

0 commit comments

Comments
 (0)