Skip to content

Commit

Permalink
Auto merge of #119552 - krtab:dead_code_priv_mod_pub_field, r=cjgillo…
Browse files Browse the repository at this point in the history
…t,saethlin

Replace visibility test with reachability test in dead code detection

Fixes #119545

Also included is a fix for an error now flagged by the lint
  • Loading branch information
bors committed Mar 23, 2024
2 parents 83eaede + a64942a commit a951158
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ pub struct CodegenCx<'gcc, 'tcx> {
local_gen_sym_counter: Cell<usize>,

eh_personality: Cell<Option<RValue<'gcc>>>,
#[cfg(feature="master")]
pub rust_try_fn: Cell<Option<(Type<'gcc>, Function<'gcc>)>>,

pub pointee_infos: RefCell<FxHashMap<(Ty<'tcx>, Size), Option<PointeeInfo>>>,
Expand All @@ -121,6 +122,7 @@ pub struct CodegenCx<'gcc, 'tcx> {
/// FIXME(antoyo): fix the rustc API to avoid having this hack.
pub structs_as_pointer: RefCell<FxHashSet<RValue<'gcc>>>,

#[cfg(feature="master")]
pub cleanup_blocks: RefCell<FxHashSet<Block<'gcc>>>,
}

Expand Down Expand Up @@ -325,9 +327,11 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
struct_types: Default::default(),
local_gen_sym_counter: Cell::new(0),
eh_personality: Cell::new(None),
#[cfg(feature="master")]
rust_try_fn: Cell::new(None),
pointee_infos: Default::default(),
structs_as_pointer: Default::default(),
#[cfg(feature="master")]
cleanup_blocks: Default::default(),
};
// TODO(antoyo): instead of doing this, add SsizeT to libgccjit.
Expand Down

0 comments on commit a951158

Please sign in to comment.