mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 01:05:39 +03:00
Add an (perma-)unstable option to disable vtable vptr
This flag is intended for evaluation of trait upcasting space cost for embedded use cases.
This commit is contained in:
@@ -807,6 +807,7 @@ macro_rules! tracked {
|
||||
tracked!(no_jump_tables, true);
|
||||
tracked!(no_link, true);
|
||||
tracked!(no_profiler_runtime, true);
|
||||
tracked!(no_trait_vptr, true);
|
||||
tracked!(no_unique_section_names, true);
|
||||
tracked!(oom, OomStrategy::Panic);
|
||||
tracked!(osx_rpath_install_name, true);
|
||||
|
||||
@@ -1631,6 +1631,8 @@ pub(crate) fn parse_dump_solver_proof_tree(
|
||||
"run LLVM in non-parallel mode (while keeping codegen-units and ThinLTO)"),
|
||||
no_profiler_runtime: bool = (false, parse_no_flag, [TRACKED],
|
||||
"prevent automatic injection of the profiler_builtins crate"),
|
||||
no_trait_vptr: bool = (false, parse_no_flag, [TRACKED],
|
||||
"disable generation of trait vptr in vtable for upcasting"),
|
||||
no_unique_section_names: bool = (false, parse_bool, [TRACKED],
|
||||
"do not use unique names for text and data sections when -Z function-sections is used"),
|
||||
normalize_docs: bool = (false, parse_bool, [TRACKED],
|
||||
|
||||
@@ -152,7 +152,7 @@ fn prepare_vtable_segments_inner<'tcx, T>(
|
||||
while let Some((inner_most_trait_ref, emit_vptr, mut siblings)) = stack.pop() {
|
||||
segment_visitor(VtblSegment::TraitOwnEntries {
|
||||
trait_ref: inner_most_trait_ref,
|
||||
emit_vptr,
|
||||
emit_vptr: emit_vptr && !tcx.sess.opts.unstable_opts.no_trait_vptr,
|
||||
})?;
|
||||
|
||||
// If we've emitted (fed to `segment_visitor`) a trait that has methods present in the vtable,
|
||||
|
||||
Reference in New Issue
Block a user