1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

llvm-cov: Remove dead code

FunctionCoverageMapping::PrettyName was from a version of the tool
during review, and isn't actually used currently.

llvm-svn: 217398
This commit is contained in:
Justin Bogner 2014-09-08 19:51:21 +00:00
parent 082ca75fd6
commit bb93be54d8
4 changed files with 7 additions and 10 deletions

View File

@ -368,7 +368,7 @@ bool CodeCoverageTool::createSourceFileView(
for (auto Function : InstantiationSet.second) { for (auto Function : InstantiationSet.second) {
auto SubView = llvm::make_unique<SourceCoverageView>( auto SubView = llvm::make_unique<SourceCoverageView>(
View, InterestingRange.first, InterestingRange.second, View, InterestingRange.first, InterestingRange.second,
Function->PrettyName); Function->Name);
createInstantiationSubView(SourceFile, *Function, *SubView); createInstantiationSubView(SourceFile, *Function, *SubView);
View.addChild(std::move(SubView)); View.addChild(std::move(SubView));
} }
@ -417,7 +417,7 @@ bool CodeCoverageTool::load() {
if (Error && !RegionError) { if (Error && !RegionError) {
colored_ostream(errs(), raw_ostream::RED) colored_ostream(errs(), raw_ostream::RED)
<< "error: Regions and counters don't match in a function '" << "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"; errs() << "\n";
RegionError = true; RegionError = true;
} }
@ -623,7 +623,7 @@ int CodeCoverageTool::show(int argc, const char **argv,
Range.second); Range.second);
createSourceFileView(SourceFile, mainView, Function, true); createSourceFileView(SourceFile, mainView, Function, true);
ViewOpts.colored_ostream(outs(), raw_ostream::CYAN) ViewOpts.colored_ostream(outs(), raw_ostream::CYAN)
<< Function.PrettyName << " from " << SourceFile << ":"; << Function.Name << " from " << SourceFile << ":";
outs() << "\n"; outs() << "\n";
mainView.render(outs()); mainView.render(outs());
if (FunctionMappingRecords.size() > 1) if (FunctionMappingRecords.size() > 1)

View File

@ -18,12 +18,12 @@
using namespace llvm; using namespace llvm;
bool NameCoverageFilter::matches(const FunctionCoverageMapping &Function) { bool NameCoverageFilter::matches(const FunctionCoverageMapping &Function) {
StringRef FuncName = Function.PrettyName; StringRef FuncName = Function.Name;
return FuncName.find(Name) != StringRef::npos; return FuncName.find(Name) != StringRef::npos;
} }
bool NameRegexCoverageFilter::matches(const FunctionCoverageMapping &Function) { 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) { bool RegionCoverageFilter::matches(const FunctionCoverageMapping &Function) {

View File

@ -65,7 +65,7 @@ FunctionCoverageSummary::get(const FunctionCoverageMapping &Function) {
NumLines += LineCount; NumLines += LineCount;
} }
return FunctionCoverageSummary( return FunctionCoverageSummary(
Function.PrettyName, RegionCoverageInfo(CoveredRegions, NumCodeRegions), Function.Name, RegionCoverageInfo(CoveredRegions, NumCodeRegions),
LineCoverageInfo(CoveredLines, 0, NumLines)); LineCoverageInfo(CoveredLines, 0, NumLines));
} }

View File

@ -35,14 +35,11 @@ struct MappingRegion : public coverage::CounterMappingRegion {
struct FunctionCoverageMapping { struct FunctionCoverageMapping {
/// \brief Raw function name. /// \brief Raw function name.
std::string Name; std::string Name;
/// \brief Demangled function name.
std::string PrettyName;
std::vector<std::string> Filenames; std::vector<std::string> Filenames;
std::vector<MappingRegion> MappingRegions; std::vector<MappingRegion> MappingRegions;
FunctionCoverageMapping(StringRef Name, ArrayRef<StringRef> Filenames) FunctionCoverageMapping(StringRef Name, ArrayRef<StringRef> Filenames)
: Name(Name), PrettyName(Name), : Name(Name), Filenames(Filenames.begin(), Filenames.end()) {}
Filenames(Filenames.begin(), Filenames.end()) {}
}; };
} // namespace llvm } // namespace llvm