diff options
| author | Ralf Jung <post@ralfj.de> | 2024-07-02 08:21:57 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-07-02 08:21:57 +0200 |
| commit | cbea3d7add356898fdfc84e9433baaa514df5552 (patch) | |
| tree | d3a4cadce7ec832453d49cb1d9d1c6fce3dd6ce5 /compiler/rustc_codegen_llvm/src/debuginfo | |
| parent | 3e44883606ad4df77018c157971ba7a47e540088 (diff) | |
| parent | 9f32459c988dec799458f304bbc49ed5dc6ef772 (diff) | |
| download | rust-cbea3d7add356898fdfc84e9433baaa514df5552.tar.gz rust-cbea3d7add356898fdfc84e9433baaa514df5552.zip | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs index 8de4e0effad..742bfd76590 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs @@ -1449,12 +1449,18 @@ fn build_vtable_type_di_node<'ll, 'tcx>( .di_node } -fn vcall_visibility_metadata<'ll, 'tcx>( +pub(crate) fn apply_vcall_visibility_metadata<'ll, 'tcx>( cx: &CodegenCx<'ll, 'tcx>, ty: Ty<'tcx>, trait_ref: Option<PolyExistentialTraitRef<'tcx>>, vtable: &'ll Value, ) { + // FIXME(flip1995): The virtual function elimination optimization only works with full LTO in + // LLVM at the moment. + if !cx.sess().opts.unstable_opts.virtual_function_elimination || cx.sess().lto() != Lto::Fat { + return; + } + enum VCallVisibility { Public = 0, LinkageUnit = 1, @@ -1531,12 +1537,6 @@ pub fn create_vtable_di_node<'ll, 'tcx>( poly_trait_ref: Option<ty::PolyExistentialTraitRef<'tcx>>, vtable: &'ll Value, ) { - // FIXME(flip1995): The virtual function elimination optimization only works with full LTO in - // LLVM at the moment. - if cx.sess().opts.unstable_opts.virtual_function_elimination && cx.sess().lto() == Lto::Fat { - vcall_visibility_metadata(cx, ty, poly_trait_ref, vtable); - } - if cx.dbg_cx.is_none() { return; } |
