Skip to content

Commit d086491

Browse files
committed
Merge branch 'users/chapuni/cov/single/merge' into users/chapuni/cov/single/base
2 parents bc708d5 + 5fc3408 commit d086491

28 files changed

+1499
-425
lines changed

llvm/lib/ProfileData/Coverage/CoverageMapping.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@ Error CoverageMapping::loadFunctionRecord(
839839
else
840840
OrigFuncName = getFuncNameWithoutPrefix(OrigFuncName, Record.Filenames[0]);
841841

842+
bool SingleByteCoverage = ProfileReader.hasSingleByteCoverage();
842843
CounterMappingContext Ctx(Record.Expressions);
843844

844845
std::vector<uint64_t> Counts;
@@ -904,8 +905,10 @@ Error CoverageMapping::loadFunctionRecord(
904905
consumeError(std::move(E));
905906
return Error::success();
906907
}
907-
Function.pushRegion(Region, *ExecutionCount, *AltExecutionCount,
908-
ProfileReader.hasSingleByteCoverage());
908+
Function.pushRegion(
909+
Region, (SingleByteCoverage && *ExecutionCount ? 1 : *ExecutionCount),
910+
(SingleByteCoverage && *AltExecutionCount ? 1 : *AltExecutionCount),
911+
SingleByteCoverage);
909912

910913
// Record ExpansionRegion.
911914
if (Region.Kind == CounterMappingRegion::ExpansionRegion) {
Lines changed: 297 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,297 @@
1+
# Instrument block coverage
2+
:single_byte_coverage
3+
big_switch
4+
# Func Hash:
5+
13144136522122330070
6+
# Num Counters:
7+
27
8+
# Counter Values:
9+
1
10+
1
11+
1
12+
1
13+
1
14+
1
15+
1
16+
0
17+
1
18+
1
19+
1
20+
1
21+
1
22+
1
23+
1
24+
1
25+
1
26+
1
27+
1
28+
1
29+
1
30+
1
31+
1
32+
1
33+
1
34+
1
35+
1
36+
37+
boolean_operators
38+
# Func Hash:
39+
1245693242827665
40+
# Num Counters:
41+
17
42+
# Counter Values:
43+
1
44+
1
45+
1
46+
1
47+
1
48+
1
49+
1
50+
1
51+
1
52+
1
53+
1
54+
1
55+
1
56+
1
57+
1
58+
1
59+
1
60+
61+
boolop_loops
62+
# Func Hash:
63+
12402604614320574815
64+
# Num Counters:
65+
23
66+
# Counter Values:
67+
1
68+
0
69+
1
70+
1
71+
1
72+
1
73+
0
74+
1
75+
1
76+
1
77+
1
78+
0
79+
1
80+
1
81+
1
82+
1
83+
1
84+
0
85+
1
86+
1
87+
1
88+
1
89+
1
90+
91+
branch-c-general.c:static_func
92+
# Func Hash:
93+
18129
94+
# Num Counters:
95+
5
96+
# Counter Values:
97+
1
98+
1
99+
1
100+
1
101+
1
102+
103+
conditional_operator
104+
# Func Hash:
105+
54992
106+
# Num Counters:
107+
5
108+
# Counter Values:
109+
1
110+
1
111+
0
112+
1
113+
1
114+
115+
conditionals
116+
# Func Hash:
117+
4904767535850050386
118+
# Num Counters:
119+
25
120+
# Counter Values:
121+
1
122+
1
123+
1
124+
1
125+
1
126+
1
127+
0
128+
1
129+
1
130+
1
131+
1
132+
1
133+
1
134+
1
135+
1
136+
1
137+
1
138+
1
139+
1
140+
1
141+
1
142+
1
143+
1
144+
1
145+
1
146+
147+
do_fallthrough
148+
# Func Hash:
149+
8714614136504380050
150+
# Num Counters:
151+
10
152+
# Counter Values:
153+
1
154+
1
155+
1
156+
1
157+
1
158+
1
159+
1
160+
1
161+
1
162+
1
163+
164+
early_exits
165+
# Func Hash:
166+
2880354649761471549
167+
# Num Counters:
168+
20
169+
# Counter Values:
170+
1
171+
0
172+
1
173+
1
174+
1
175+
1
176+
1
177+
1
178+
1
179+
1
180+
1
181+
1
182+
1
183+
1
184+
0
185+
1
186+
1
187+
1
188+
0
189+
0
190+
191+
jumps
192+
# Func Hash:
193+
15051420506203462683
194+
# Num Counters:
195+
38
196+
# Counter Values:
197+
1
198+
1
199+
0
200+
1
201+
0
202+
0
203+
0
204+
1
205+
0
206+
1
207+
1
208+
0
209+
1
210+
1
211+
0
212+
1
213+
1
214+
1
215+
1
216+
1
217+
1
218+
1
219+
0
220+
1
221+
1
222+
0
223+
1
224+
1
225+
1
226+
1
227+
1
228+
1
229+
1
230+
0
231+
0
232+
1
233+
1
234+
1
235+
236+
main
237+
# Func Hash:
238+
24
239+
# Num Counters:
240+
1
241+
# Counter Values:
242+
1
243+
244+
simple_loops
245+
# Func Hash:
246+
1245818015463121
247+
# Num Counters:
248+
11
249+
# Counter Values:
250+
1
251+
1
252+
1
253+
1
254+
1
255+
1
256+
1
257+
1
258+
1
259+
1
260+
1
261+
262+
switches
263+
# Func Hash:
264+
43242458792028222
265+
# Num Counters:
266+
29
267+
# Counter Values:
268+
1
269+
1
270+
1
271+
1
272+
1
273+
1
274+
0
275+
1
276+
1
277+
0
278+
1
279+
1
280+
1
281+
1
282+
1
283+
1
284+
1
285+
1
286+
1
287+
1
288+
0
289+
1
290+
1
291+
1
292+
1
293+
1
294+
1
295+
0
296+
0
297+

0 commit comments

Comments
 (0)