comparison tools/llvm-cov/CoverageSummaryInfo.h @ 134:3a76565eade5 LLVM5.0.1

update 5.0.1
author mir3636
date Sat, 17 Feb 2018 09:57:20 +0900
parents 803732b1fca8
children c2174574ed3a
comparison
equal deleted inserted replaced
133:c60214abe0e8 134:3a76565eade5
113 public: 113 public:
114 FunctionCoverageInfo() : Executed(0), NumFunctions(0) {} 114 FunctionCoverageInfo() : Executed(0), NumFunctions(0) {}
115 115
116 FunctionCoverageInfo(size_t Executed, size_t NumFunctions) 116 FunctionCoverageInfo(size_t Executed, size_t NumFunctions)
117 : Executed(Executed), NumFunctions(NumFunctions) {} 117 : Executed(Executed), NumFunctions(NumFunctions) {}
118
119 FunctionCoverageInfo &operator+=(const FunctionCoverageInfo &RHS) {
120 Executed += RHS.Executed;
121 NumFunctions += RHS.NumFunctions;
122 return *this;
123 }
118 124
119 void addFunction(bool Covered) { 125 void addFunction(bool Covered) {
120 if (Covered) 126 if (Covered)
121 ++Executed; 127 ++Executed;
122 ++NumFunctions; 128 ++NumFunctions;
174 180
175 FileCoverageSummary(StringRef Name) 181 FileCoverageSummary(StringRef Name)
176 : Name(Name), RegionCoverage(), LineCoverage(), FunctionCoverage(), 182 : Name(Name), RegionCoverage(), LineCoverage(), FunctionCoverage(),
177 InstantiationCoverage() {} 183 InstantiationCoverage() {}
178 184
185 FileCoverageSummary &operator+=(const FileCoverageSummary &RHS) {
186 RegionCoverage += RHS.RegionCoverage;
187 LineCoverage += RHS.LineCoverage;
188 FunctionCoverage += RHS.FunctionCoverage;
189 InstantiationCoverage += RHS.InstantiationCoverage;
190 return *this;
191 }
192
179 void addFunction(const FunctionCoverageSummary &Function) { 193 void addFunction(const FunctionCoverageSummary &Function) {
180 RegionCoverage += Function.RegionCoverage; 194 RegionCoverage += Function.RegionCoverage;
181 LineCoverage += Function.LineCoverage; 195 LineCoverage += Function.LineCoverage;
182 FunctionCoverage.addFunction(/*Covered=*/Function.ExecutionCount > 0); 196 FunctionCoverage.addFunction(/*Covered=*/Function.ExecutionCount > 0);
183 } 197 }