Skip to content

Commit 0c9ba01

Browse files
authored
Rollup merge of rust-lang#127779 - momvart:should_codegen_hook, r=cjgillot
Add a hook for `should_codegen_locally` This PR lifts the module-local function `should_codegen_locally` to `TyCtxt` as a hook. In addition to monomorphization, this function is used for checking the dependency of `compiler_builtins` on other libraries. Moving this function to the hooks also makes overriding it possible for the tools that use the rustc interface.
2 parents c1c13bd + c01fe3c commit 0c9ba01

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

src/abi/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ use std::mem;
1010
use cranelift_codegen::ir::{ArgumentPurpose, SigRef};
1111
use cranelift_codegen::isa::CallConv;
1212
use cranelift_module::ModuleError;
13+
use rustc_codegen_ssa::base::is_call_from_compiler_builtins_to_upstream_monomorphization;
1314
use rustc_codegen_ssa::errors::CompilerBuiltinsCannotCall;
1415
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
1516
use rustc_middle::ty::layout::FnAbiOf;
1617
use rustc_middle::ty::print::with_no_trimmed_paths;
1718
use rustc_middle::ty::TypeVisitableExt;
18-
use rustc_monomorphize::is_call_from_compiler_builtins_to_upstream_monomorphization;
1919
use rustc_session::Session;
2020
use rustc_span::source_map::Spanned;
2121
use rustc_target::abi::call::{Conv, FnAbi, PassMode};

src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ use cranelift_codegen::CodegenError;
55
use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
66
use cranelift_module::ModuleError;
77
use rustc_ast::InlineAsmOptions;
8+
use rustc_codegen_ssa::base::is_call_from_compiler_builtins_to_upstream_monomorphization;
89
use rustc_index::IndexVec;
910
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
1011
use rustc_middle::ty::adjustment::PointerCoercion;
1112
use rustc_middle::ty::layout::FnAbiOf;
1213
use rustc_middle::ty::print::with_no_trimmed_paths;
1314
use rustc_middle::ty::TypeVisitableExt;
14-
use rustc_monomorphize::is_call_from_compiler_builtins_to_upstream_monomorphization;
1515

1616
use crate::constant::ConstantCx;
1717
use crate::debuginfo::{FunctionDebugContext, TypeDebugContext};

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ extern crate rustc_hir;
2424
extern crate rustc_incremental;
2525
extern crate rustc_index;
2626
extern crate rustc_metadata;
27-
extern crate rustc_monomorphize;
2827
extern crate rustc_session;
2928
extern crate rustc_span;
3029
extern crate rustc_target;

0 commit comments

Comments
 (0)