Skip to content

Commit 95d68a6

Browse files
committed
Strip vestigial Shim suffix from ShimKind variants
1 parent 6ac5d7d commit 95d68a6

23 files changed

Lines changed: 211 additions & 223 deletions

File tree

compiler/rustc_codegen_cranelift/src/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub(crate) fn codegen_tls_ref<'tcx>(
5353
) -> CValue<'tcx> {
5454
let tls_ptr = if !def_id.is_local() && fx.tcx.needs_thread_local_shim(def_id) {
5555
let instance = ty::Instance {
56-
def: ty::InstanceKind::Shim(ty::ShimKind::ThreadLocalShim(def_id)),
56+
def: ty::InstanceKind::Shim(ty::ShimKind::ThreadLocal(def_id)),
5757
args: ty::GenericArgs::empty(),
5858
};
5959
let func_ref = fx.get_function_ref(instance);

compiler/rustc_codegen_ssa/src/back/symbol_export.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ fn exported_generic_symbols_provider_local<'tcx>(
361361
}
362362
}
363363
MonoItem::Fn(Instance {
364-
def: InstanceKind::Shim(ShimKind::AsyncDropGlueCtorShim(_, ty)),
364+
def: InstanceKind::Shim(ShimKind::AsyncDropGlueCtor(_, ty)),
365365
args,
366366
}) => {
367367
// A little sanity-check
@@ -586,7 +586,7 @@ pub(crate) fn symbol_name_for_instance_in_crate<'tcx>(
586586
rustc_symbol_mangling::symbol_name_for_instance_in_crate(
587587
tcx,
588588
ty::Instance {
589-
def: ty::InstanceKind::Shim(ty::ShimKind::ThreadLocalShim(def_id)),
589+
def: ty::InstanceKind::Shim(ty::ShimKind::ThreadLocal(def_id)),
590590
args: ty::GenericArgs::empty(),
591591
},
592592
instantiating_crate,

compiler/rustc_codegen_ssa/src/mir/rvalue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
665665
let static_ = if !def_id.is_local() && bx.cx().tcx().needs_thread_local_shim(def_id)
666666
{
667667
let instance = ty::Instance {
668-
def: ty::InstanceKind::Shim(ty::ShimKind::ThreadLocalShim(def_id)),
668+
def: ty::InstanceKind::Shim(ty::ShimKind::ThreadLocal(def_id)),
669669
args: ty::GenericArgs::empty(),
670670
};
671671
let fn_ptr = bx.get_fn_addr(instance);

compiler/rustc_const_eval/src/interpret/call.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
428428
// Determine whether this is a non-capturing closure. That's relevant as their first
429429
// argument can be skipped (and that's the only kind of argument skipping we allow).
430430
let is_non_capturing_closure =
431-
(matches!(instance.def, ty::InstanceKind::Shim(ty::ShimKind::ClosureOnceShim { .. }))
431+
(matches!(instance.def, ty::InstanceKind::Shim(ty::ShimKind::ClosureOnce { .. }))
432432
|| self.tcx.is_closure_like(def_id))
433433
&& {
434434
let arg = &callee_fn_abi.args[0];
@@ -652,18 +652,18 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
652652
interp_ok(())
653653
}
654654
}
655-
ty::InstanceKind::Shim(ty::ShimKind::VTableShim(..))
656-
| ty::InstanceKind::Shim(ty::ShimKind::ReifyShim(..))
657-
| ty::InstanceKind::Shim(ty::ShimKind::ClosureOnceShim { .. })
658-
| ty::InstanceKind::Shim(ty::ShimKind::ConstructCoroutineInClosureShim { .. })
659-
| ty::InstanceKind::Shim(ty::ShimKind::FnPtrShim(..))
655+
ty::InstanceKind::Shim(ty::ShimKind::VTable(..))
656+
| ty::InstanceKind::Shim(ty::ShimKind::Reify(..))
657+
| ty::InstanceKind::Shim(ty::ShimKind::ClosureOnce { .. })
658+
| ty::InstanceKind::Shim(ty::ShimKind::ConstructCoroutineInClosure { .. })
659+
| ty::InstanceKind::Shim(ty::ShimKind::FnPtr(..))
660660
| ty::InstanceKind::Shim(ty::ShimKind::DropGlue(..))
661-
| ty::InstanceKind::Shim(ty::ShimKind::CloneShim(..))
662-
| ty::InstanceKind::Shim(ty::ShimKind::FnPtrAddrShim(..))
663-
| ty::InstanceKind::Shim(ty::ShimKind::ThreadLocalShim(..))
664-
| ty::InstanceKind::Shim(ty::ShimKind::AsyncDropGlueCtorShim(..))
661+
| ty::InstanceKind::Shim(ty::ShimKind::Clone(..))
662+
| ty::InstanceKind::Shim(ty::ShimKind::FnPtrAddr(..))
663+
| ty::InstanceKind::Shim(ty::ShimKind::ThreadLocal(..))
664+
| ty::InstanceKind::Shim(ty::ShimKind::AsyncDropGlueCtor(..))
665665
| ty::InstanceKind::Shim(ty::ShimKind::AsyncDropGlue(..))
666-
| ty::InstanceKind::Shim(ty::ShimKind::FutureDropPollShim(..))
666+
| ty::InstanceKind::Shim(ty::ShimKind::FutureDropPoll(..))
667667
| ty::InstanceKind::Item(_) => {
668668
// We need MIR for this fn.
669669
// Note that this can be an intrinsic, if we are executing its fallback body.

compiler/rustc_middle/src/middle/codegen_fn_attrs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl<'tcx> TyCtxt<'tcx> {
3333
//
3434
// A `ClosureOnceShim` with the track_caller attribute does not have a symbol,
3535
// and therefore can be skipped here.
36-
if let InstanceKind::Shim(ShimKind::ReifyShim(_, _)) = instance_kind
36+
if let InstanceKind::Shim(ShimKind::Reify(_, _)) = instance_kind
3737
&& attrs.flags.contains(CodegenFnAttrFlags::TRACK_CALLER)
3838
{
3939
if attrs.flags.contains(CodegenFnAttrFlags::NO_MANGLE) {
@@ -54,7 +54,7 @@ impl<'tcx> TyCtxt<'tcx> {
5454
}
5555

5656
// Ensure closure shims have the optimization properties of their closure applied to them.
57-
if let InstanceKind::Shim(ShimKind::ClosureOnceShim {
57+
if let InstanceKind::Shim(ShimKind::ClosureOnce {
5858
call_once: _,
5959
closure,
6060
track_caller: _,

compiler/rustc_middle/src/middle/exported_symbols.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl<'tcx> ExportedSymbol<'tcx> {
7575
tcx.symbol_name(ty::Instance::resolve_async_drop_in_place_poll(tcx, def_id, ty))
7676
}
7777
ExportedSymbol::ThreadLocalShim(def_id) => tcx.symbol_name(ty::Instance {
78-
def: ty::InstanceKind::Shim(ty::ShimKind::ThreadLocalShim(def_id)),
78+
def: ty::InstanceKind::Shim(ty::ShimKind::ThreadLocal(def_id)),
7979
args: ty::GenericArgs::empty(),
8080
}),
8181
ExportedSymbol::NoDefId(symbol_name) => symbol_name,

compiler/rustc_middle/src/mir/pretty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ impl<'a, 'tcx> MirDumper<'a, 'tcx> {
229229
}));
230230
s
231231
}
232-
ty::InstanceKind::Shim(ty::ShimKind::AsyncDropGlueCtorShim(_, ty)) => {
232+
ty::InstanceKind::Shim(ty::ShimKind::AsyncDropGlueCtor(_, ty)) => {
233233
let mut s = ".".to_owned();
234234
s.extend(ty.to_string().chars().filter_map(|c| match c {
235235
' ' => None,
@@ -251,7 +251,7 @@ impl<'a, 'tcx> MirDumper<'a, 'tcx> {
251251
}));
252252
s
253253
}
254-
ty::InstanceKind::Shim(ty::ShimKind::FutureDropPollShim(_, proxy_cor, impl_cor)) => {
254+
ty::InstanceKind::Shim(ty::ShimKind::FutureDropPoll(_, proxy_cor, impl_cor)) => {
255255
let mut s = ".".to_owned();
256256
s.extend(proxy_cor.to_string().chars().filter_map(|c| match c {
257257
' ' => None,

compiler/rustc_middle/src/mir/visit.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -347,27 +347,27 @@ macro_rules! make_mir_visitor {
347347
ty::InstanceKind::Item(_def_id) => {}
348348

349349
ty::InstanceKind::Intrinsic(_def_id)
350-
| ty::InstanceKind::Shim(ty::ShimKind::VTableShim(_def_id))
351-
| ty::InstanceKind::Shim(ty::ShimKind::ReifyShim(_def_id, _))
350+
| ty::InstanceKind::Shim(ty::ShimKind::VTable(_def_id))
351+
| ty::InstanceKind::Shim(ty::ShimKind::Reify(_def_id, _))
352352
| ty::InstanceKind::Virtual(_def_id, _)
353-
| ty::InstanceKind::Shim(ty::ShimKind::ThreadLocalShim(_def_id))
354-
| ty::InstanceKind::Shim(ty::ShimKind::ClosureOnceShim { call_once: _def_id, closure: _, track_caller: _ })
355-
| ty::InstanceKind::Shim(ty::ShimKind::ConstructCoroutineInClosureShim {
353+
| ty::InstanceKind::Shim(ty::ShimKind::ThreadLocal(_def_id))
354+
| ty::InstanceKind::Shim(ty::ShimKind::ClosureOnce { call_once: _def_id, closure: _, track_caller: _ })
355+
| ty::InstanceKind::Shim(ty::ShimKind::ConstructCoroutineInClosure {
356356
coroutine_closure_def_id: _def_id,
357357
receiver_by_ref: _,
358358
})
359359
| ty::InstanceKind::Shim(ty::ShimKind::DropGlue(_def_id, None)) => {}
360360

361-
ty::InstanceKind::Shim(ty::ShimKind::FnPtrShim(_def_id, ty))
361+
ty::InstanceKind::Shim(ty::ShimKind::FnPtr(_def_id, ty))
362362
| ty::InstanceKind::Shim(ty::ShimKind::DropGlue(_def_id, Some(ty)))
363-
| ty::InstanceKind::Shim(ty::ShimKind::CloneShim(_def_id, ty))
364-
| ty::InstanceKind::Shim(ty::ShimKind::FnPtrAddrShim(_def_id, ty))
363+
| ty::InstanceKind::Shim(ty::ShimKind::Clone(_def_id, ty))
364+
| ty::InstanceKind::Shim(ty::ShimKind::FnPtrAddr(_def_id, ty))
365365
| ty::InstanceKind::Shim(ty::ShimKind::AsyncDropGlue(_def_id, ty))
366-
| ty::InstanceKind::Shim(ty::ShimKind::AsyncDropGlueCtorShim(_def_id, ty)) => {
366+
| ty::InstanceKind::Shim(ty::ShimKind::AsyncDropGlueCtor(_def_id, ty)) => {
367367
// FIXME(eddyb) use a better `TyContext` here.
368368
self.visit_ty($(& $mutability)? *ty, TyContext::Location(location));
369369
}
370-
ty::InstanceKind::Shim(ty::ShimKind::FutureDropPollShim(_def_id, proxy_ty, impl_ty)) => {
370+
ty::InstanceKind::Shim(ty::ShimKind::FutureDropPoll(_def_id, proxy_ty, impl_ty)) => {
371371
self.visit_ty($(& $mutability)? *proxy_ty, TyContext::Location(location));
372372
self.visit_ty($(& $mutability)? *impl_ty, TyContext::Location(location));
373373
}

compiler/rustc_middle/src/mono.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -525,18 +525,18 @@ impl<'tcx> CodegenUnit<'tcx> {
525525
InstanceKind::Item(def) => def.as_local().map(|_| def),
526526
InstanceKind::Intrinsic(..)
527527
| InstanceKind::Virtual(..)
528-
| InstanceKind::Shim(ShimKind::VTableShim(..))
529-
| InstanceKind::Shim(ShimKind::ReifyShim(..))
530-
| InstanceKind::Shim(ShimKind::FnPtrShim(..))
531-
| InstanceKind::Shim(ShimKind::ClosureOnceShim { .. })
532-
| InstanceKind::Shim(ShimKind::ConstructCoroutineInClosureShim { .. })
528+
| InstanceKind::Shim(ShimKind::VTable(..))
529+
| InstanceKind::Shim(ShimKind::Reify(..))
530+
| InstanceKind::Shim(ShimKind::FnPtr(..))
531+
| InstanceKind::Shim(ShimKind::ClosureOnce { .. })
532+
| InstanceKind::Shim(ShimKind::ConstructCoroutineInClosure { .. })
533533
| InstanceKind::Shim(ShimKind::DropGlue(..))
534-
| InstanceKind::Shim(ShimKind::CloneShim(..))
535-
| InstanceKind::Shim(ShimKind::ThreadLocalShim(..))
536-
| InstanceKind::Shim(ShimKind::FnPtrAddrShim(..))
534+
| InstanceKind::Shim(ShimKind::Clone(..))
535+
| InstanceKind::Shim(ShimKind::ThreadLocal(..))
536+
| InstanceKind::Shim(ShimKind::FnPtrAddr(..))
537537
| InstanceKind::Shim(ShimKind::AsyncDropGlue(..))
538-
| InstanceKind::Shim(ShimKind::FutureDropPollShim(..))
539-
| InstanceKind::Shim(ShimKind::AsyncDropGlueCtorShim(..)) => None,
538+
| InstanceKind::Shim(ShimKind::FutureDropPoll(..))
539+
| InstanceKind::Shim(ShimKind::AsyncDropGlueCtor(..)) => None,
540540
},
541541
MonoItem::Static(def_id) => def_id.as_local().map(|_| def_id),
542542
MonoItem::GlobalAsm(item_id) => Some(item_id.owner_id.def_id.to_def_id()),

0 commit comments

Comments
 (0)