Skip to content

Commit 8b38a2c

Browse files
Nikola TesicDjordje Todorovic
Nikola Tesic
authored and
Djordje Todorovic
committed
[Debugify][OriginalDIMode] Update script to handle large JSON reports
This patch updates llvm/utils/llvm-original-di-preservation.py to create more compact HTML verify-debuginfo-preserve reports by: - removing duplicated debug info bugs, - introducing -compress option to create highly compressed report. Additionally, this patch makes script able to process very large JSON inputs. That is done by reading & analyzing JSON report in chunks. Differential Revision: https://reviews.llvm.org/D115617
1 parent b5d28f3 commit 8b38a2c

File tree

4 files changed

+242
-97
lines changed

4 files changed

+242
-97
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<html>
2+
<head>
3+
<style>
4+
table, th, td {
5+
border: 1px solid black;
6+
}
7+
table.center {
8+
margin-left: auto;
9+
margin-right: auto;
10+
}
11+
</style>
12+
</head>
13+
<body>
14+
<table>
15+
<caption><b>Location Bugs found by the Debugify</b></caption>
16+
<tr>
17+
<th>File</th>
18+
<th>LLVM Pass Name</th>
19+
<th>LLVM IR Instruction</th>
20+
<th>Function Name</th>
21+
<th>Basic Block Name</th>
22+
<th>Action</th>
23+
</tr>
24+
</tr>
25+
<tr>
26+
<td>test.ll</td>
27+
<td>no-name</td>
28+
<td>extractvalue</td>
29+
<td>fn</td>
30+
<td>no-name</td>
31+
<td>not-generate</td>
32+
</tr>
33+
<tr>
34+
<td>test.ll</td>
35+
<td>no-name</td>
36+
<td>insertvalue</td>
37+
<td>fn</td>
38+
<td>no-name</td>
39+
<td>not-generate</td>
40+
</tr>
41+
<tr>
42+
</table>
43+
<br>
44+
<table>
45+
<caption><b>Summary of Location Bugs</b></caption>
46+
<tr>
47+
<th>LLVM Pass Name</th>
48+
<th>Number of bugs</th>
49+
</tr>
50+
<tr>
51+
<td>no-name</td>
52+
<td>8</td>
53+
</tr>
54+
<tr>
55+
</table>
56+
<br>
57+
<br>
58+
<table>
59+
<caption><b>SP Bugs found by the Debugify</b></caption>
60+
<tr>
61+
<th>File</th>
62+
<th>LLVM Pass Name</th>
63+
<th>Function Name</th>
64+
<th>Action</th>
65+
</tr>
66+
<tr>
67+
<td colspan='4'> No bugs found </td>
68+
</tr>
69+
</table>
70+
<br>
71+
<table>
72+
<caption><b>Summary of SP Bugs</b></caption>
73+
<tr>
74+
<th>LLVM Pass Name</th>
75+
<th>Number of bugs</th>
76+
</tr>
77+
<tr>
78+
<tr>
79+
<td colspan='2'> No bugs found </td>
80+
</tr>
81+
</table>
82+
<br>
83+
<br>
84+
<table>
85+
<caption><b>Variable Location Bugs found by the Debugify</b></caption>
86+
<tr>
87+
<th>File</th>
88+
<th>LLVM Pass Name</th>
89+
<th>Variable</th>
90+
<th>Function</th>
91+
<th>Action</th>
92+
</tr>
93+
<tr>
94+
<td colspan='4'> No bugs found </td>
95+
</tr>
96+
</table>
97+
<br>
98+
<table>
99+
<caption><b>Summary of Variable Location Bugs</b></caption>
100+
<tr>
101+
<th>LLVM Pass Name</th>
102+
<th>Number of bugs</th>
103+
</tr>
104+
<tr>
105+
<tr>
106+
<td colspan='2'> No bugs found </td>
107+
</tr>
108+
</table>
109+
</body>
110+
</html>

llvm/test/tools/llvm-original-di-preservation/Inputs/expected-sample.html

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,6 @@
4141
<tr>
4242
<td>test.ll</td>
4343
<td>no-name</td>
44-
<td>extractvalue</td>
45-
<td>fn</td>
46-
<td>no-name</td>
47-
<td>not-generate</td>
48-
</tr>
49-
<tr>
50-
<td>test.ll</td>
51-
<td>no-name</td>
52-
<td>insertvalue</td>
53-
<td>fn1</td>
54-
<td>no-name</td>
55-
<td>not-generate</td>
56-
</tr>
57-
<tr>
58-
<td>test.ll</td>
59-
<td>no-name</td>
6044
<td>insertvalue</td>
6145
<td>fn1</td>
6246
<td>no-name</td>
@@ -65,22 +49,6 @@
6549
<tr>
6650
<td>test.ll</td>
6751
<td>no-name</td>
68-
<td>insertvalue</td>
69-
<td>fn</td>
70-
<td>no-name</td>
71-
<td>not-generate</td>
72-
</tr>
73-
<tr>
74-
<td>test.ll</td>
75-
<td>no-name</td>
76-
<td>extractvalue</td>
77-
<td>fn1</td>
78-
<td>no-name</td>
79-
<td>not-generate</td>
80-
</tr>
81-
<tr>
82-
<td>test.ll</td>
83-
<td>no-name</td>
8452
<td>extractvalue</td>
8553
<td>fn1</td>
8654
<td>no-name</td>

llvm/test/tools/llvm-original-di-preservation/basic.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ RUN: %llvm-original-di-preservation %p/Inputs/corrupted.json %t2.html | FileChec
66
RUN: diff -w %p/Inputs/expected-skipped.html %t2.html
77
CORRUPTED: Skipped lines: 3
88
CORRUPTED: Skipped bugs: 1
9+
10+
RUN: %llvm-original-di-preservation -compress %p/Inputs/sample.json %t3.html | FileCheck %s -check-prefix=COMPRESSED
11+
RUN: diff -w %p/Inputs/expected-compressed.html %t3.html
12+
COMPRESSED-NOT: Skipped lines:
13+

0 commit comments

Comments
 (0)