Rollup merge of #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.
This commit is contained in:
commit
9a6f8ccf3a
9 changed files with 62 additions and 58 deletions
|
@ -103,6 +103,10 @@ declare_hooks! {
|
|||
|
||||
/// Create a list-like THIR representation for debugging.
|
||||
hook thir_flat(key: LocalDefId) -> String;
|
||||
|
||||
/// Returns `true` if we should codegen an instance in the local crate, or returns `false` if we
|
||||
/// can just link to the upstream crate and therefore don't need a mono item.
|
||||
hook should_codegen_locally(instance: crate::ty::Instance<'tcx>) -> bool;
|
||||
}
|
||||
|
||||
#[cold]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue