Skip to content

Rollup of 8 pull requests #140475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
14491b0
Use START_BLOCK in codegen_naked_asm
bjorn3 Dec 12, 2024
03f4e88
Handle protected visibility in codegen_naked_asm
bjorn3 Dec 12, 2024
ffdc292
Don't begin defining a function when codegening a naked function
bjorn3 Dec 12, 2024
1988de5
Only require a CodegenCx for codegen_naked_asm
bjorn3 Dec 12, 2024
764d3a5
Make codegen_naked_asm retrieve the MIR Body itself
bjorn3 Dec 12, 2024
a73eba9
Move codegen_naked_asm call up into MonoItem::define
bjorn3 Dec 12, 2024
e2e96fa
Pass MonoItemData to MonoItem::define
bjorn3 Dec 12, 2024
94e95f3
Make codegen_naked_asm public
bjorn3 Dec 12, 2024
421f22e
Pass &mut self to codegen_global_asm
bjorn3 Dec 12, 2024
f5c93fa
Use cg_ssa's version of codegen_naked_asm in cg_clif
bjorn3 Dec 12, 2024
3066da8
Share part of the global_asm!() implementation between cg_ssa and cg_…
bjorn3 Dec 13, 2024
5b1e495
Add a few extra tests to `tests/ui/macros/stringify.rs`.
nnethercote Apr 23, 2025
99f6b63
Improve pretty-printing of braces.
nnethercote May 17, 2024
cf12e29
enable msa feature for mips in codegen tests
koalatux Apr 29, 2025
4fe94ba
add `rust.debug-assertions-tools` option
pietroalbini Apr 29, 2025
2393e44
miri: algebraic intrinsics: bring back float non-determinism
RalfJung Apr 29, 2025
478b378
Move `on impl position` test to proper directory
mejrs Apr 29, 2025
fc2cd77
Fix comment describing what the test does
mejrs Apr 29, 2025
923ca85
Add test
oli-obk Apr 29, 2025
a1c7059
Treat `ManuallyDrop` as `~const Destruct`
oli-obk Apr 29, 2025
a4ce307
Coalesce duplicate missing clone tests
mejrs Apr 29, 2025
64bcf3b
Rename `rustc_query_append!` to `rustc_with_all_queries!`
Zalathar Apr 29, 2025
ed2f4b6
Reformat parameters to macros used by with-all-queries
Zalathar Apr 29, 2025
40ebd1b
Rollup merge of #134232 - bjorn3:naked_asm_improvements, r=wesleywiser
tgross35 Apr 29, 2025
3e26eb9
Rollup merge of #140312 - nnethercote:DelimArgs-spacing, r=petrochenkov
tgross35 Apr 29, 2025
f241cb1
Rollup merge of #140437 - husqvarnagroup:af/codegen-test-mips-msa, r=…
tgross35 Apr 29, 2025
3ef052f
Rollup merge of #140438 - ferrocene:pa-debug-assertions-tools, r=Kobzol
tgross35 Apr 29, 2025
8719830
Rollup merge of #140439 - RalfJung:miri-algebraic-float-nondet, r=oli…
tgross35 Apr 29, 2025
59613f5
Rollup merge of #140445 - oli-obk:const-manually-drop, r=fee1-dead
tgross35 Apr 29, 2025
ef36ca5
Rollup merge of #140446 - mejrs:test1, r=jieyouxu
tgross35 Apr 29, 2025
9529cc4
Rollup merge of #140448 - Zalathar:query-append, r=compiler-errors
tgross35 Apr 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Pass &mut self to codegen_global_asm
  • Loading branch information
bjorn3 committed Apr 14, 2025
commit 421f22e8bf404d7b67395a66e60300e99452549a
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl

impl<'gcc, 'tcx> AsmCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
fn codegen_global_asm(
&self,
&mut self,
template: &[InlineAsmTemplatePiece],
operands: &[GlobalAsmOperandRef<'tcx>],
options: InlineAsmOptions,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_gcc/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ pub fn compile_codegen_unit(
let f128_type_supported = target_info.supports_target_dependent_type(CType::Float128);
let u128_type_supported = target_info.supports_target_dependent_type(CType::UInt128t);
// TODO: improve this to avoid passing that many arguments.
let cx = CodegenCx::new(
let mut cx = CodegenCx::new(
&context,
cgu,
tcx,
Expand All @@ -224,7 +224,7 @@ pub fn compile_codegen_unit(

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

// If this codegen unit contains the main function, also create the
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ enum ExtremumOperation {
Min,
}

pub struct Builder<'a: 'gcc, 'gcc, 'tcx> {
pub struct Builder<'a, 'gcc, 'tcx> {
pub cx: &'a CodegenCx<'gcc, 'tcx>,
pub block: Block<'gcc>,
pub location: Option<Location<'gcc>>,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {

impl<'tcx> AsmCodegenMethods<'tcx> for CodegenCx<'_, 'tcx> {
fn codegen_global_asm(
&self,
&mut self,
template: &[InlineAsmTemplatePiece],
operands: &[GlobalAsmOperandRef<'tcx>],
options: InlineAsmOptions,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_llvm/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ pub(crate) fn compile_codegen_unit(
// Instantiate monomorphizations without filling out definitions yet...
let llvm_module = ModuleLlvm::new(tcx, cgu_name.as_str());
{
let cx = CodegenCx::new(tcx, cgu, &llvm_module);
let mut cx = CodegenCx::new(tcx, cgu, &llvm_module);
let mono_items = cx.codegen_unit.items_in_deterministic_order(cx.tcx);
for &(mono_item, data) in &mono_items {
mono_item.predefine::<Builder<'_, '_, '_>>(&cx, data.linkage, data.visibility);
}

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

// If this codegen unit contains the main function, also create the
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/mir/naked_asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn codegen_naked_asm<
+ FnAbiOf<'tcx, FnAbiOfResult = &'tcx FnAbi<'tcx, Ty<'tcx>>>
+ AsmCodegenMethods<'tcx>,
>(
cx: &'a Cx,
cx: &'a mut Cx,
instance: Instance<'tcx>,
item_data: MonoItemData,
) {
Expand Down
12 changes: 10 additions & 2 deletions compiler/rustc_codegen_ssa/src/mono_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ use crate::traits::*;
use crate::{base, common};

pub trait MonoItemExt<'a, 'tcx> {
fn define<Bx: BuilderMethods<'a, 'tcx>>(&self, cx: &'a Bx::CodegenCx, item_data: MonoItemData);
fn define<Bx: BuilderMethods<'a, 'tcx>>(
&self,
cx: &'a mut Bx::CodegenCx,
item_data: MonoItemData,
);
fn predefine<Bx: BuilderMethods<'a, 'tcx>>(
&self,
cx: &'a Bx::CodegenCx,
Expand All @@ -23,7 +27,11 @@ pub trait MonoItemExt<'a, 'tcx> {
}

impl<'a, 'tcx: 'a> MonoItemExt<'a, 'tcx> for MonoItem<'tcx> {
fn define<Bx: BuilderMethods<'a, 'tcx>>(&self, cx: &'a Bx::CodegenCx, item_data: MonoItemData) {
fn define<Bx: BuilderMethods<'a, 'tcx>>(
&self,
cx: &'a mut Bx::CodegenCx,
item_data: MonoItemData,
) {
debug!(
"BEGIN IMPLEMENTING '{} ({})' in cgu {}",
self,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/traits/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub trait AsmBuilderMethods<'tcx>: BackendTypes {

pub trait AsmCodegenMethods<'tcx> {
fn codegen_global_asm(
&self,
&mut self,
template: &[InlineAsmTemplatePiece],
operands: &[GlobalAsmOperandRef<'tcx>],
options: InlineAsmOptions,
Expand Down