From 3b30e077abb0748da6661f373f5eb91937fbdc13 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 11 Jun 2023 13:19:20 -0700 Subject: [PATCH] [ProfileData] Remove unused class SoftInstrProfErrors The last use was removed by: commit 98cce00371d271c9da8de806e4cc4c886a85d56c Author: David Blaikie Date: Mon Jul 10 03:04:59 2017 +0000 Differential Revision: https://reviews.llvm.org/D152640 --- llvm/include/llvm/ProfileData/InstrProf.h | 55 ------------------------------- llvm/lib/ProfileData/InstrProf.cpp | 25 -------------- 2 files changed, 80 deletions(-) diff --git a/llvm/include/llvm/ProfileData/InstrProf.h b/llvm/include/llvm/ProfileData/InstrProf.h index ccdcebf..a3e21b2 100644 --- a/llvm/include/llvm/ProfileData/InstrProf.h +++ b/llvm/include/llvm/ProfileData/InstrProf.h @@ -394,61 +394,6 @@ private: std::string Msg; }; -class SoftInstrProfErrors { - /// Count the number of soft instrprof_errors encountered and keep track of - /// the first such error for reporting purposes. - - /// The first soft error encountered. - instrprof_error FirstError = instrprof_error::success; - - /// The number of hash mismatches. - unsigned NumHashMismatches = 0; - - /// The number of count mismatches. - unsigned NumCountMismatches = 0; - - /// The number of counter overflows. - unsigned NumCounterOverflows = 0; - - /// The number of value site count mismatches. - unsigned NumValueSiteCountMismatches = 0; - -public: - SoftInstrProfErrors() = default; - - ~SoftInstrProfErrors() { - assert(FirstError == instrprof_error::success && - "Unchecked soft error encountered"); - } - - /// Track a soft error (\p IE) and increment its associated counter. - void addError(instrprof_error IE); - - /// Get the number of hash mismatches. - unsigned getNumHashMismatches() const { return NumHashMismatches; } - - /// Get the number of count mismatches. - unsigned getNumCountMismatches() const { return NumCountMismatches; } - - /// Get the number of counter overflows. - unsigned getNumCounterOverflows() const { return NumCounterOverflows; } - - /// Get the number of value site count mismatches. - unsigned getNumValueSiteCountMismatches() const { - return NumValueSiteCountMismatches; - } - - /// Return the first encountered error and reset FirstError to a success - /// value. - Error takeError() { - if (FirstError == instrprof_error::success) - return Error::success(); - auto E = make_error(FirstError); - FirstError = instrprof_error::success; - return E; - } -}; - namespace object { class SectionRef; diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp index 9bb091a4..5ce474b 100644 --- a/llvm/lib/ProfileData/InstrProf.cpp +++ b/llvm/lib/ProfileData/InstrProf.cpp @@ -233,31 +233,6 @@ std::string getInstrProfSectionName(InstrProfSectKind IPSK, return SectName; } -void SoftInstrProfErrors::addError(instrprof_error IE) { - if (IE == instrprof_error::success) - return; - - if (FirstError == instrprof_error::success) - FirstError = IE; - - switch (IE) { - case instrprof_error::hash_mismatch: - ++NumHashMismatches; - break; - case instrprof_error::count_mismatch: - ++NumCountMismatches; - break; - case instrprof_error::counter_overflow: - ++NumCounterOverflows; - break; - case instrprof_error::value_site_count_mismatch: - ++NumValueSiteCountMismatches; - break; - default: - llvm_unreachable("Not a soft error"); - } -} - std::string InstrProfError::message() const { return getInstrProfErrString(Err, Msg); } -- 2.7.4