Skip to content

Commit 36465dc

Browse files
committed
Merge branch 'users/chapuni/cov/single/replace' into users/chapuni/cov/single/nextcount-base
2 parents 702a72e + ed700c2 commit 36465dc

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,10 @@ class CounterExpressionBuilder {
215215
/// LHS.
216216
Counter subtract(Counter LHS, Counter RHS, bool Simplify = true);
217217

218-
using ReplaceMap = std::map<Counter, Counter>;
218+
using SubstMap = std::map<Counter, Counter>;
219219

220-
/// Return a counter for each term in the expression replaced by ReplaceMap.
221-
Counter replace(Counter C, const ReplaceMap &Map);
220+
/// Return a counter for each term in the expression replaced by SubstMap.
221+
Counter subst(Counter C, const SubstMap &Map);
222222
};
223223

224224
using LineColPair = std::pair<unsigned, unsigned>;

llvm/lib/ProfileData/Coverage/CoverageMapping.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,17 @@ Counter CounterExpressionBuilder::subtract(Counter LHS, Counter RHS,
135135
return Simplify ? simplify(Cnt) : Cnt;
136136
}
137137

138-
Counter CounterExpressionBuilder::replace(Counter C, const ReplaceMap &Map) {
138+
Counter CounterExpressionBuilder::subst(Counter C, const SubstMap &Map) {
139139
// Replace C with the value found in Map even if C is Expression.
140140
if (auto I = Map.find(C); I != Map.end())
141141
return I->second;
142142

143143
if (!C.isExpression())
144144
return C;
145145

146-
// Traverse both sides of Expression.
147146
auto CE = Expressions[C.getExpressionID()];
148-
auto NewLHS = replace(CE.LHS, Map);
149-
auto NewRHS = replace(CE.RHS, Map);
147+
auto NewLHS = subst(CE.LHS, Map);
148+
auto NewRHS = subst(CE.RHS, Map);
150149

151150
// Reconstruct Expression with induced subexpressions.
152151
switch (CE.Kind) {

0 commit comments

Comments
 (0)