File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
llvm/lib/ProfileData/Coverage Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,18 @@ void CoverageMappingWriter::write(raw_ostream &OS) {
167
167
return LHS.FileID < RHS.FileID ;
168
168
if (LHS.startLoc () != RHS.startLoc ())
169
169
return LHS.startLoc () < RHS.startLoc ();
170
- return LHS.Kind < RHS.Kind ;
170
+
171
+ // Put `Decision` before `Expansion`.
172
+ auto getKindKey = [](CounterMappingRegion::RegionKind Kind) {
173
+ return (Kind == CounterMappingRegion::MCDCDecisionRegion
174
+ ? 2 * CounterMappingRegion::ExpansionRegion - 1
175
+ : 2 * Kind);
176
+ };
177
+
178
+ auto LHSKindKey = getKindKey (LHS.Kind );
179
+ auto RHSKindKey = getKindKey (RHS.Kind );
180
+
181
+ return LHSKindKey < RHSKindKey;
171
182
});
172
183
173
184
// Write out the fileid -> filename mapping.
You can’t perform that action at this time.
0 commit comments