Skip to content

Commit

Permalink
llvm-cov: Remove dead code
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bogner committed Sep 8, 2014
1 parent beeca54 commit 69062a3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
6 changes: 3 additions & 3 deletions tools/llvm-cov/CodeCoverage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ bool CodeCoverageTool::createSourceFileView(
for (auto Function : InstantiationSet.second) {
auto SubView = llvm::make_unique<SourceCoverageView>(
View, InterestingRange.first, InterestingRange.second,
Function->PrettyName);
Function->Name);
createInstantiationSubView(SourceFile, *Function, *SubView);
View.addChild(std::move(SubView));
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tools/llvm-cov/CoverageFilters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tools/llvm-cov/CoverageSummaryInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
5 changes: 1 addition & 4 deletions tools/llvm-cov/FunctionCoverageMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> Filenames;
std::vector<MappingRegion> MappingRegions;

FunctionCoverageMapping(StringRef Name, ArrayRef<StringRef> Filenames)
: Name(Name), PrettyName(Name),
Filenames(Filenames.begin(), Filenames.end()) {}
: Name(Name), Filenames(Filenames.begin(), Filenames.end()) {}
};

} // namespace llvm
Expand Down

0 comments on commit 69062a3

Please sign in to comment.