From 69062a3c65ce58291b13d8d3d71b93c8f41fe108 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Mon, 8 Sep 2014 19:51:21 +0000 Subject: [PATCH] llvm-cov: Remove dead code FunctionCoverageMapping::PrettyName was from a version of the tool during review, and isn't actually used currently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217398 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-cov/CodeCoverage.cpp | 6 +++--- tools/llvm-cov/CoverageFilters.cpp | 4 ++-- tools/llvm-cov/CoverageSummaryInfo.cpp | 2 +- tools/llvm-cov/FunctionCoverageMapping.h | 5 +---- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tools/llvm-cov/CodeCoverage.cpp b/tools/llvm-cov/CodeCoverage.cpp index bc77a9ee285..a19a22bc192 100644 --- a/tools/llvm-cov/CodeCoverage.cpp +++ b/tools/llvm-cov/CodeCoverage.cpp @@ -368,7 +368,7 @@ bool CodeCoverageTool::createSourceFileView( for (auto Function : InstantiationSet.second) { auto SubView = llvm::make_unique( View, InterestingRange.first, InterestingRange.second, - Function->PrettyName); + Function->Name); createInstantiationSubView(SourceFile, *Function, *SubView); View.addChild(std::move(SubView)); } @@ -417,7 +417,7 @@ bool CodeCoverageTool::load() { if (Error && !RegionError) { colored_ostream(errs(), raw_ostream::RED) << "error: Regions and counters don't match in a function '" - << Function.PrettyName << "' (re-run the instrumented binary)."; + << Function.Name << "' (re-run the instrumented binary)."; errs() << "\n"; RegionError = true; } @@ -623,7 +623,7 @@ int CodeCoverageTool::show(int argc, const char **argv, Range.second); createSourceFileView(SourceFile, mainView, Function, true); ViewOpts.colored_ostream(outs(), raw_ostream::CYAN) - << Function.PrettyName << " from " << SourceFile << ":"; + << Function.Name << " from " << SourceFile << ":"; outs() << "\n"; mainView.render(outs()); if (FunctionMappingRecords.size() > 1) diff --git a/tools/llvm-cov/CoverageFilters.cpp b/tools/llvm-cov/CoverageFilters.cpp index 3732d729b6c..999a6bbb747 100644 --- a/tools/llvm-cov/CoverageFilters.cpp +++ b/tools/llvm-cov/CoverageFilters.cpp @@ -18,12 +18,12 @@ using namespace llvm; bool NameCoverageFilter::matches(const FunctionCoverageMapping &Function) { - StringRef FuncName = Function.PrettyName; + StringRef FuncName = Function.Name; return FuncName.find(Name) != StringRef::npos; } bool NameRegexCoverageFilter::matches(const FunctionCoverageMapping &Function) { - return llvm::Regex(Regex).match(Function.PrettyName); + return llvm::Regex(Regex).match(Function.Name); } bool RegionCoverageFilter::matches(const FunctionCoverageMapping &Function) { diff --git a/tools/llvm-cov/CoverageSummaryInfo.cpp b/tools/llvm-cov/CoverageSummaryInfo.cpp index 765bb3ef84f..8ed805ed068 100644 --- a/tools/llvm-cov/CoverageSummaryInfo.cpp +++ b/tools/llvm-cov/CoverageSummaryInfo.cpp @@ -65,7 +65,7 @@ FunctionCoverageSummary::get(const FunctionCoverageMapping &Function) { NumLines += LineCount; } return FunctionCoverageSummary( - Function.PrettyName, RegionCoverageInfo(CoveredRegions, NumCodeRegions), + Function.Name, RegionCoverageInfo(CoveredRegions, NumCodeRegions), LineCoverageInfo(CoveredLines, 0, NumLines)); } diff --git a/tools/llvm-cov/FunctionCoverageMapping.h b/tools/llvm-cov/FunctionCoverageMapping.h index d171483cee9..77440a99e6d 100644 --- a/tools/llvm-cov/FunctionCoverageMapping.h +++ b/tools/llvm-cov/FunctionCoverageMapping.h @@ -35,14 +35,11 @@ struct MappingRegion : public coverage::CounterMappingRegion { struct FunctionCoverageMapping { /// \brief Raw function name. std::string Name; - /// \brief Demangled function name. - std::string PrettyName; std::vector Filenames; std::vector MappingRegions; FunctionCoverageMapping(StringRef Name, ArrayRef Filenames) - : Name(Name), PrettyName(Name), - Filenames(Filenames.begin(), Filenames.end()) {} + : Name(Name), Filenames(Filenames.begin(), Filenames.end()) {} }; } // namespace llvm -- 2.11.0