File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
llvm/lib/ProfileData/Coverage Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,15 @@ void CoverageMappingWriter::write(raw_ostream &OS) {
165
165
const CounterMappingRegion &RHS) {
166
166
if (LHS.FileID != RHS.FileID )
167
167
return LHS.FileID < RHS.FileID ;
168
- if (LHS.startLoc () != RHS.startLoc ())
168
+
169
+ auto ignoreLocationComparison = [](const CounterMappingRegion &LHS,
170
+ const CounterMappingRegion &RHS) {
171
+ return (LHS.Kind == CounterMappingRegion::MCDCBranchRegion ||
172
+ LHS.Kind == CounterMappingRegion::MCDCDecisionRegion) &&
173
+ LHS.Kind == RHS.Kind ;
174
+ };
175
+
176
+ if (!ignoreLocationComparison (LHS, RHS) && LHS.startLoc () != RHS.startLoc ())
169
177
return LHS.startLoc () < RHS.startLoc ();
170
178
171
179
// Put `Decision` before `Expansion`.
You can’t perform that action at this time.
0 commit comments