mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Remove some depgraph edges on the HIR by invoking the intrinsic query instead of checking the attribute
This commit is contained in:
parent
b3dcbc2931
commit
bf5fc6e5d7
@ -16,7 +16,6 @@ use rustc_middle::ty::{self, SymbolName, TyCtxt};
|
|||||||
use rustc_middle::ty::{GenericArgKind, GenericArgsRef};
|
use rustc_middle::ty::{GenericArgKind, GenericArgsRef};
|
||||||
use rustc_middle::util::Providers;
|
use rustc_middle::util::Providers;
|
||||||
use rustc_session::config::{CrateType, OomStrategy};
|
use rustc_session::config::{CrateType, OomStrategy};
|
||||||
use rustc_span::sym;
|
|
||||||
use rustc_target::spec::{SanitizerSet, TlsModel};
|
use rustc_target::spec::{SanitizerSet, TlsModel};
|
||||||
|
|
||||||
pub fn threshold(tcx: TyCtxt<'_>) -> SymbolExportLevel {
|
pub fn threshold(tcx: TyCtxt<'_>) -> SymbolExportLevel {
|
||||||
@ -82,7 +81,7 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, _: LocalCrate) -> DefIdMap<S
|
|||||||
return library.kind.is_statically_included().then_some(def_id);
|
return library.kind.is_statically_included().then_some(def_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if tcx.has_attr(def_id, sym::rustc_intrinsic_must_be_overridden) {
|
if tcx.intrinsic(def_id).is_some_and(|i| i.must_be_overridden) {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ fn cross_crate_inlinable(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if tcx.has_attr(def_id, sym::rustc_intrinsic_must_be_overridden) {
|
if tcx.intrinsic(def_id).is_some_and(|i| i.must_be_overridden) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -632,9 +632,9 @@ fn optimized_mir(tcx: TyCtxt<'_>, did: LocalDefId) -> &Body<'_> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn inner_optimized_mir(tcx: TyCtxt<'_>, did: LocalDefId) -> Body<'_> {
|
fn inner_optimized_mir(tcx: TyCtxt<'_>, did: LocalDefId) -> Body<'_> {
|
||||||
if let Some(attr) = tcx.get_attr(did, sym::rustc_intrinsic_must_be_overridden) {
|
if tcx.intrinsic(did).is_some_and(|i| i.must_be_overridden) {
|
||||||
span_bug!(
|
span_bug!(
|
||||||
attr.span,
|
tcx.def_span(did),
|
||||||
"this intrinsic must be overridden by the codegen backend, it has no meaningful body",
|
"this intrinsic must be overridden by the codegen backend, it has no meaningful body",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1019,7 +1019,7 @@ fn should_codegen_locally<'tcx>(tcx: TyCtxt<'tcx>, instance: &Instance<'tcx>) ->
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if tcx.has_attr(def_id, sym::rustc_intrinsic_must_be_overridden) {
|
if tcx.intrinsic(def_id).is_some_and(|i| i.must_be_overridden) {
|
||||||
// These are implemented by backends directly and have no meaningful body.
|
// These are implemented by backends directly and have no meaningful body.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user