[llvm] r293868 - [opt-viewer] Alternating row background colors on index page
Adam Nemet via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 1 21:49:00 PST 2017
Author: anemet
Date: Wed Feb 1 23:49:00 2017
New Revision: 293868
URL: http://llvm.org/viewvc/llvm-project?rev=293868&view=rev
Log:
[opt-viewer] Alternating row background colors on index page
Modified:
llvm/trunk/utils/opt-viewer/opt-viewer.py
llvm/trunk/utils/opt-viewer/style.css
Modified: llvm/trunk/utils/opt-viewer/opt-viewer.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/opt-viewer/opt-viewer.py?rev=293868&r1=293867&r2=293868&view=diff
==============================================================================
--- llvm/trunk/utils/opt-viewer/opt-viewer.py (original)
+++ llvm/trunk/utils/opt-viewer/opt-viewer.py Wed Feb 1 23:49:00 2017
@@ -253,12 +253,12 @@ class IndexRenderer:
def __init__(self, output_dir):
self.stream = open(os.path.join(output_dir, 'index.html'), 'w')
- def render_entry(self, r):
+ def render_entry(self, r, odd):
print('''
<tr>
-<td><a href={r.Link}>{r.DebugLocString}</a></td>
-<td>{r.RelativeHotness}</td>
-<td>{r.DemangledFunctionName}</td>
+<td class=\"column-entry-{odd}\"><a href={r.Link}>{r.DebugLocString}</a></td>
+<td class=\"column-entry-{odd}\">{r.RelativeHotness}</td>
+<td class=\"column-entry-{odd}\">{r.DemangledFunctionName}</td>
<td class=\"column-entry-{r.color}\">{r.Pass}</td>
</tr>'''.format(**locals()), file=self.stream)
@@ -277,8 +277,8 @@ class IndexRenderer:
<td>Function</td>
<td>Pass</td>
</tr>''', file=self.stream)
- for remark in all_remarks:
- self.render_entry(remark)
+ for i, remark in enumerate(all_remarks):
+ self.render_entry(remark, i % 2)
print('''
</table>
</body>
Modified: llvm/trunk/utils/opt-viewer/style.css
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/opt-viewer/style.css?rev=293868&r1=293867&r2=293868&view=diff
==============================================================================
--- llvm/trunk/utils/opt-viewer/style.css (original)
+++ llvm/trunk/utils/opt-viewer/style.css Wed Feb 1 23:49:00 2017
@@ -62,6 +62,12 @@ table {
text-align: left;
background-color: #ffe1a6;
}
+.column-entry-0 {
+ background-color: #ffffff;
+}
+.column-entry-1 {
+ background-color: #eeeeee;
+}
.line-number {
text-align: right;
color: #aaa;
More information about the llvm-commits
mailing list