about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2023-07-05 17:56:10 +1000
committerZalathar <Zalathar@users.noreply.github.com>2023-07-05 20:40:40 +1000
commit9c430d38cf10ec3fab459be00e87057e5cce55b0 (patch)
tree60d0fa5da082e711f3c3c4322059723479679967 /compiler/rustc_codegen_ssa
parent4169d0f756dde8b3e692610bddb3c948c5cd53ea (diff)
downloadrust-9c430d38cf10ec3fab459be00e87057e5cce55b0.tar.gz
rust-9c430d38cf10ec3fab459be00e87057e5cce55b0.zip
Remove trait `CoverageInfoMethods`, since non-LLVM backends don't need it
These methods are only ever called from within `rustc_codegen_llvm`, so they
can just be declared there as well.
Diffstat (limited to 'compiler/rustc_codegen_ssa')
-rw-r--r--compiler/rustc_codegen_ssa/src/traits/coverageinfo.rs18
-rw-r--r--compiler/rustc_codegen_ssa/src/traits/mod.rs4
2 files changed, 1 insertions, 21 deletions
diff --git a/compiler/rustc_codegen_ssa/src/traits/coverageinfo.rs b/compiler/rustc_codegen_ssa/src/traits/coverageinfo.rs
index 75b125b3016..7e8de0ddc5b 100644
--- a/compiler/rustc_codegen_ssa/src/traits/coverageinfo.rs
+++ b/compiler/rustc_codegen_ssa/src/traits/coverageinfo.rs
@@ -1,25 +1,7 @@
 use super::BackendTypes;
-use rustc_hir::def_id::DefId;
 use rustc_middle::mir::Coverage;
 use rustc_middle::ty::Instance;
 
-pub trait CoverageInfoMethods<'tcx>: BackendTypes {
-    fn coverageinfo_finalize(&self);
-
-    /// Codegen a small function that will never be called, with one counter
-    /// that will never be incremented, that gives LLVM coverage tools a
-    /// function definition it needs in order to resolve coverage map references
-    /// to unused functions. This is necessary so unused functions will appear
-    /// as uncovered (coverage execution count `0`) in LLVM coverage reports.
-    fn define_unused_fn(&self, def_id: DefId);
-
-    /// For LLVM codegen, returns a function-specific `Value` for a global
-    /// string, to hold the function name passed to LLVM intrinsic
-    /// `instrprof.increment()`. The `Value` is only created once per instance.
-    /// Multiple invocations with the same instance return the same `Value`.
-    fn get_pgo_func_name_var(&self, instance: Instance<'tcx>) -> Self::Value;
-}
-
 pub trait CoverageInfoBuilderMethods<'tcx>: BackendTypes {
     /// Handle the MIR coverage info in a backend-specific way.
     ///
diff --git a/compiler/rustc_codegen_ssa/src/traits/mod.rs b/compiler/rustc_codegen_ssa/src/traits/mod.rs
index 782fdadbfb8..8cb58bd4c70 100644
--- a/compiler/rustc_codegen_ssa/src/traits/mod.rs
+++ b/compiler/rustc_codegen_ssa/src/traits/mod.rs
@@ -33,7 +33,7 @@ pub use self::asm::{AsmBuilderMethods, AsmMethods, GlobalAsmOperandRef, InlineAs
 pub use self::backend::{Backend, BackendTypes, CodegenBackend, ExtraBackendMethods};
 pub use self::builder::{BuilderMethods, OverflowOp};
 pub use self::consts::ConstMethods;
-pub use self::coverageinfo::{CoverageInfoBuilderMethods, CoverageInfoMethods};
+pub use self::coverageinfo::CoverageInfoBuilderMethods;
 pub use self::debuginfo::{DebugInfoBuilderMethods, DebugInfoMethods};
 pub use self::declare::PreDefineMethods;
 pub use self::intrinsic::IntrinsicCallMethods;
@@ -59,7 +59,6 @@ pub trait CodegenMethods<'tcx>:
     + MiscMethods<'tcx>
     + ConstMethods<'tcx>
     + StaticMethods
-    + CoverageInfoMethods<'tcx>
     + DebugInfoMethods<'tcx>
     + AsmMethods<'tcx>
     + PreDefineMethods<'tcx>
@@ -75,7 +74,6 @@ impl<'tcx, T> CodegenMethods<'tcx> for T where
         + MiscMethods<'tcx>
         + ConstMethods<'tcx>
         + StaticMethods
-        + CoverageInfoMethods<'tcx>
         + DebugInfoMethods<'tcx>
         + AsmMethods<'tcx>
         + PreDefineMethods<'tcx>