Skip to content

Commit 510943a

Browse files
committed
remove remaining references to Reveal
1 parent 329cd79 commit 510943a

File tree

6 files changed

+32
-26
lines changed

6 files changed

+32
-26
lines changed

src/abi/mod.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub(crate) fn get_function_sig<'tcx>(
8080
clif_sig_from_fn_abi(
8181
tcx,
8282
default_call_conv,
83-
&RevealAllLayoutCx(tcx).fn_abi_of_instance(inst, ty::List::empty()),
83+
&FullyMonomorphizedLayoutCx(tcx).fn_abi_of_instance(inst, ty::List::empty()),
8484
)
8585
}
8686

@@ -438,9 +438,9 @@ pub(crate) fn codegen_terminator_call<'tcx>(
438438
extra_args.iter().map(|op_arg| fx.monomorphize(op_arg.node.ty(fx.mir, fx.tcx))),
439439
);
440440
let fn_abi = if let Some(instance) = instance {
441-
RevealAllLayoutCx(fx.tcx).fn_abi_of_instance(instance, extra_args)
441+
FullyMonomorphizedLayoutCx(fx.tcx).fn_abi_of_instance(instance, extra_args)
442442
} else {
443-
RevealAllLayoutCx(fx.tcx).fn_abi_of_fn_ptr(fn_sig, extra_args)
443+
FullyMonomorphizedLayoutCx(fx.tcx).fn_abi_of_fn_ptr(fn_sig, extra_args)
444444
};
445445

446446
let is_cold = if fn_sig.abi() == ExternAbi::RustCold {
@@ -721,8 +721,8 @@ pub(crate) fn codegen_drop<'tcx>(
721721
def: ty::InstanceKind::Virtual(drop_instance.def_id(), 0),
722722
args: drop_instance.args,
723723
};
724-
let fn_abi =
725-
RevealAllLayoutCx(fx.tcx).fn_abi_of_instance(virtual_drop, ty::List::empty());
724+
let fn_abi = FullyMonomorphizedLayoutCx(fx.tcx)
725+
.fn_abi_of_instance(virtual_drop, ty::List::empty());
726726

727727
let sig = clif_sig_from_fn_abi(fx.tcx, fx.target_config.default_call_conv, &fn_abi);
728728
let sig = fx.bcx.import_signature(sig);
@@ -764,8 +764,8 @@ pub(crate) fn codegen_drop<'tcx>(
764764
def: ty::InstanceKind::Virtual(drop_instance.def_id(), 0),
765765
args: drop_instance.args,
766766
};
767-
let fn_abi =
768-
RevealAllLayoutCx(fx.tcx).fn_abi_of_instance(virtual_drop, ty::List::empty());
767+
let fn_abi = FullyMonomorphizedLayoutCx(fx.tcx)
768+
.fn_abi_of_instance(virtual_drop, ty::List::empty());
769769

770770
let sig = clif_sig_from_fn_abi(fx.tcx, fx.target_config.default_call_conv, &fn_abi);
771771
let sig = fx.bcx.import_signature(sig);
@@ -774,8 +774,8 @@ pub(crate) fn codegen_drop<'tcx>(
774774
_ => {
775775
assert!(!matches!(drop_instance.def, InstanceKind::Virtual(_, _)));
776776

777-
let fn_abi =
778-
RevealAllLayoutCx(fx.tcx).fn_abi_of_instance(drop_instance, ty::List::empty());
777+
let fn_abi = FullyMonomorphizedLayoutCx(fx.tcx)
778+
.fn_abi_of_instance(drop_instance, ty::List::empty());
779779

780780
let arg_value = drop_place.place_ref(
781781
fx,

src/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub(crate) fn codegen_fn<'tcx>(
103103
let block_map: IndexVec<BasicBlock, Block> =
104104
(0..mir.basic_blocks.len()).map(|_| bcx.create_block()).collect();
105105

106-
let fn_abi = RevealAllLayoutCx(tcx).fn_abi_of_instance(instance, ty::List::empty());
106+
let fn_abi = FullyMonomorphizedLayoutCx(tcx).fn_abi_of_instance(instance, ty::List::empty());
107107

108108
// Make FunctionCx
109109
let target_config = module.target_config();

src/common.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ pub(crate) struct FunctionCx<'m, 'clif, 'tcx: 'm> {
311311
impl<'tcx> LayoutOfHelpers<'tcx> for FunctionCx<'_, '_, 'tcx> {
312312
#[inline]
313313
fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> ! {
314-
RevealAllLayoutCx(self.tcx).handle_layout_err(err, span, ty)
314+
FullyMonomorphizedLayoutCx(self.tcx).handle_layout_err(err, span, ty)
315315
}
316316
}
317317

@@ -323,7 +323,7 @@ impl<'tcx> FnAbiOfHelpers<'tcx> for FunctionCx<'_, '_, 'tcx> {
323323
span: Span,
324324
fn_abi_request: FnAbiRequest<'tcx>,
325325
) -> ! {
326-
RevealAllLayoutCx(self.tcx).handle_fn_abi_err(err, span, fn_abi_request)
326+
FullyMonomorphizedLayoutCx(self.tcx).handle_fn_abi_err(err, span, fn_abi_request)
327327
}
328328
}
329329

@@ -443,9 +443,9 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> {
443443
}
444444
}
445445

446-
pub(crate) struct RevealAllLayoutCx<'tcx>(pub(crate) TyCtxt<'tcx>);
446+
pub(crate) struct FullyMonomorphizedLayoutCx<'tcx>(pub(crate) TyCtxt<'tcx>);
447447

448-
impl<'tcx> LayoutOfHelpers<'tcx> for RevealAllLayoutCx<'tcx> {
448+
impl<'tcx> LayoutOfHelpers<'tcx> for FullyMonomorphizedLayoutCx<'tcx> {
449449
#[inline]
450450
fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> ! {
451451
if let LayoutError::SizeOverflow(_) | LayoutError::ReferencesError(_) = err {
@@ -459,7 +459,7 @@ impl<'tcx> LayoutOfHelpers<'tcx> for RevealAllLayoutCx<'tcx> {
459459
}
460460
}
461461

462-
impl<'tcx> FnAbiOfHelpers<'tcx> for RevealAllLayoutCx<'tcx> {
462+
impl<'tcx> FnAbiOfHelpers<'tcx> for FullyMonomorphizedLayoutCx<'tcx> {
463463
#[inline]
464464
fn handle_fn_abi_err(
465465
&self,
@@ -485,25 +485,25 @@ impl<'tcx> FnAbiOfHelpers<'tcx> for RevealAllLayoutCx<'tcx> {
485485
}
486486
}
487487

488-
impl<'tcx> layout::HasTyCtxt<'tcx> for RevealAllLayoutCx<'tcx> {
488+
impl<'tcx> layout::HasTyCtxt<'tcx> for FullyMonomorphizedLayoutCx<'tcx> {
489489
fn tcx<'b>(&'b self) -> TyCtxt<'tcx> {
490490
self.0
491491
}
492492
}
493493

494-
impl<'tcx> rustc_abi::HasDataLayout for RevealAllLayoutCx<'tcx> {
494+
impl<'tcx> rustc_abi::HasDataLayout for FullyMonomorphizedLayoutCx<'tcx> {
495495
fn data_layout(&self) -> &rustc_abi::TargetDataLayout {
496496
&self.0.data_layout
497497
}
498498
}
499499

500-
impl<'tcx> layout::HasTypingEnv<'tcx> for RevealAllLayoutCx<'tcx> {
500+
impl<'tcx> layout::HasTypingEnv<'tcx> for FullyMonomorphizedLayoutCx<'tcx> {
501501
fn typing_env(&self) -> ty::TypingEnv<'tcx> {
502502
ty::TypingEnv::fully_monomorphized()
503503
}
504504
}
505505

506-
impl<'tcx> HasTargetSpec for RevealAllLayoutCx<'tcx> {
506+
impl<'tcx> HasTargetSpec for FullyMonomorphizedLayoutCx<'tcx> {
507507
fn target_spec(&self) -> &Target {
508508
&self.0.sess.target
509509
}

src/debuginfo/types.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc_data_structures::fx::FxHashMap;
66
use rustc_middle::ty::layout::LayoutOf;
77
use rustc_middle::ty::{self, Ty, TyCtxt};
88

9-
use crate::{DebugContext, RevealAllLayoutCx, has_ptr_meta};
9+
use crate::{DebugContext, FullyMonomorphizedLayoutCx, has_ptr_meta};
1010

1111
#[derive(Default)]
1212
pub(crate) struct TypeDebugContext<'tcx> {
@@ -85,7 +85,7 @@ impl DebugContext {
8585
type_entry.set(gimli::DW_AT_encoding, AttributeValue::Encoding(encoding));
8686
type_entry.set(
8787
gimli::DW_AT_byte_size,
88-
AttributeValue::Udata(RevealAllLayoutCx(tcx).layout_of(ty).size.bytes()),
88+
AttributeValue::Udata(FullyMonomorphizedLayoutCx(tcx).layout_of(ty).size.bytes()),
8989
);
9090

9191
type_id
@@ -159,7 +159,7 @@ impl DebugContext {
159159
return_if_type_created_in_meantime!(type_dbg, tuple_type);
160160

161161
let name = type_names::compute_debuginfo_type_name(tcx, tuple_type, false);
162-
let layout = RevealAllLayoutCx(tcx).layout_of(tuple_type);
162+
let layout = FullyMonomorphizedLayoutCx(tcx).layout_of(tuple_type);
163163

164164
let tuple_type_id =
165165
self.dwarf.unit.add(self.dwarf.unit.root(), gimli::DW_TAG_structure_type);
@@ -178,7 +178,9 @@ impl DebugContext {
178178
member_entry.set(gimli::DW_AT_type, AttributeValue::UnitRef(dw_ty));
179179
member_entry.set(
180180
gimli::DW_AT_alignment,
181-
AttributeValue::Udata(RevealAllLayoutCx(tcx).layout_of(ty).align.pref.bytes()),
181+
AttributeValue::Udata(
182+
FullyMonomorphizedLayoutCx(tcx).layout_of(ty).align.pref.bytes(),
183+
),
182184
);
183185
member_entry.set(
184186
gimli::DW_AT_data_member_location,
@@ -198,7 +200,11 @@ impl DebugContext {
198200
self.debug_type(
199201
tcx,
200202
type_dbg,
201-
Ty::new_array(tcx, tcx.types.u8, RevealAllLayoutCx(tcx).layout_of(ty).size.bytes()),
203+
Ty::new_array(
204+
tcx,
205+
tcx.types.u8,
206+
FullyMonomorphizedLayoutCx(tcx).layout_of(ty).size.bytes(),
207+
),
202208
)
203209
}
204210
}

src/global_asm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub(crate) fn codegen_global_asm_item(tcx: TyCtxt<'_>, global_asm: &mut String,
4242
tcx,
4343
op_sp,
4444
const_value,
45-
RevealAllLayoutCx(tcx).layout_of(ty),
45+
FullyMonomorphizedLayoutCx(tcx).layout_of(ty),
4646
);
4747
global_asm.push_str(&string);
4848
}

src/inline_asm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ pub(crate) fn codegen_naked_asm<'tcx>(
238238
tcx,
239239
span,
240240
const_value,
241-
RevealAllLayoutCx(tcx).layout_of(cv.ty()),
241+
FullyMonomorphizedLayoutCx(tcx).layout_of(cv.ty()),
242242
);
243243
CInlineAsmOperand::Const { value }
244244
}

0 commit comments

Comments
 (0)