Skip to content

Commit ad72e0d

Browse files
committed
Rename *AsmOperandRef::Const to Interpolate
This is used for string interpolation currently, so rename it as so. The name `Const` will be used to denote a general CTFE constant that can either be integer or pointer.
1 parent 9bad8ac commit ad72e0d

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

compiler/rustc_codegen_gcc/src/asm.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
272272
}
273273
}
274274

275-
InlineAsmOperandRef::Const { ref string } => {
275+
InlineAsmOperandRef::Interpolate { ref string } => {
276276
constants_len += string.len() + att_dialect as usize;
277277
}
278278

@@ -387,7 +387,7 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
387387
});
388388
}
389389

390-
InlineAsmOperandRef::Const { .. } => {
390+
InlineAsmOperandRef::Interpolate { .. } => {
391391
// processed in the previous pass
392392
}
393393

@@ -480,7 +480,7 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
480480
template_str.push_str(name);
481481
}
482482

483-
InlineAsmOperandRef::Const { ref string } => {
483+
InlineAsmOperandRef::Interpolate { ref string } => {
484484
template_str.push_str(string);
485485
}
486486

@@ -830,7 +830,7 @@ impl<'gcc, 'tcx> AsmCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
830830
}
831831
InlineAsmTemplatePiece::Placeholder { operand_idx, modifier: _, span: _ } => {
832832
match operands[operand_idx] {
833-
GlobalAsmOperandRef::Const { ref string } => {
833+
GlobalAsmOperandRef::Interpolate { ref string } => {
834834
// Const operands get injected directly into the
835835
// template. Note that we don't need to escape %
836836
// here unlike normal inline assembly.

compiler/rustc_codegen_llvm/src/asm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl<'ll, 'tcx> AsmBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> {
205205
template_str.push_str(&format!("${{{}}}", op_idx[&operand_idx]));
206206
}
207207
}
208-
InlineAsmOperandRef::Const { ref string } => {
208+
InlineAsmOperandRef::Interpolate { ref string } => {
209209
// Const operands get injected directly into the template
210210
template_str.push_str(string);
211211
}
@@ -398,7 +398,7 @@ impl<'tcx> AsmCodegenMethods<'tcx> for CodegenCx<'_, 'tcx> {
398398
InlineAsmTemplatePiece::String(ref s) => template_str.push_str(s),
399399
InlineAsmTemplatePiece::Placeholder { operand_idx, modifier: _, span: _ } => {
400400
match operands[operand_idx] {
401-
GlobalAsmOperandRef::Const { ref string } => {
401+
GlobalAsmOperandRef::Interpolate { ref string } => {
402402
// Const operands get injected directly into the
403403
// template. Note that we don't need to escape $
404404
// here unlike normal inline assembly.

compiler/rustc_codegen_ssa/src/mir/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
12381238
const_value,
12391239
bx.layout_of(value.ty()),
12401240
);
1241-
InlineAsmOperandRef::Const { string }
1241+
InlineAsmOperandRef::Interpolate { string }
12421242
}
12431243
mir::InlineAsmOperand::SymFn { ref value } => {
12441244
let const_ = self.monomorphize(value.const_);

compiler/rustc_codegen_ssa/src/mir/naked_asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn inline_to_global_operand<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
7676
cx.layout_of(mono_type),
7777
);
7878

79-
GlobalAsmOperandRef::Const { string }
79+
GlobalAsmOperandRef::Interpolate { string }
8080
}
8181
InlineAsmOperand::SymFn { value } => {
8282
let mono_type = instance.instantiate_mir_and_normalize_erasing_regions(

compiler/rustc_codegen_ssa/src/mono_item.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ impl<'a, 'tcx: 'a> MonoItemExt<'a, 'tcx> for MonoItem<'tcx> {
5454
const_value,
5555
cx.layout_of(ty),
5656
);
57-
GlobalAsmOperandRef::Const { string }
57+
GlobalAsmOperandRef::Interpolate { string }
5858
}
5959
Err(ErrorHandled::Reported { .. }) => {
6060
// An error has already been reported and
6161
// compilation is guaranteed to fail if execution
6262
// hits this path. So an empty string instead of
6363
// a stringified constant value will suffice.
64-
GlobalAsmOperandRef::Const { string: String::new() }
64+
GlobalAsmOperandRef::Interpolate { string: String::new() }
6565
}
6666
Err(ErrorHandled::TooGeneric(_)) => {
6767
span_bug!(

compiler/rustc_codegen_ssa/src/traits/asm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub enum InlineAsmOperandRef<'tcx, B: BackendTypes + ?Sized> {
2525
in_value: OperandRef<'tcx, B::Value>,
2626
out_place: Option<PlaceRef<'tcx, B::Value>>,
2727
},
28-
Const {
28+
Interpolate {
2929
string: String,
3030
},
3131
SymFn {
@@ -41,7 +41,7 @@ pub enum InlineAsmOperandRef<'tcx, B: BackendTypes + ?Sized> {
4141

4242
#[derive(Debug)]
4343
pub enum GlobalAsmOperandRef<'tcx> {
44-
Const { string: String },
44+
Interpolate { string: String },
4545
SymFn { instance: Instance<'tcx> },
4646
SymStatic { def_id: DefId },
4747
}

0 commit comments

Comments
 (0)