[llvm] r326125 - [opt-viewer] Set title for the source pages
Adam Nemet via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 26 13:15:50 PST 2018
Author: anemet
Date: Mon Feb 26 13:15:50 2018
New Revision: 326125
URL: http://llvm.org/viewvc/llvm-project?rev=326125&view=rev
Log:
[opt-viewer] Set title for the source pages
Modified:
llvm/trunk/test/tools/opt-viewer/Outputs/basic/basic_or.c.html
llvm/trunk/test/tools/opt-viewer/Outputs/basic/basic_or.h.html
llvm/trunk/test/tools/opt-viewer/Outputs/suppress/s.swift.html
llvm/trunk/test/tools/opt-viewer/Outputs/unicode-function-name/s.swift.html
llvm/trunk/tools/opt-viewer/opt-viewer.py
Modified: llvm/trunk/test/tools/opt-viewer/Outputs/basic/basic_or.c.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/opt-viewer/Outputs/basic/basic_or.c.html?rev=326125&r1=326124&r2=326125&view=diff
==============================================================================
--- llvm/trunk/test/tools/opt-viewer/Outputs/basic/basic_or.c.html (original)
+++ llvm/trunk/test/tools/opt-viewer/Outputs/basic/basic_or.c.html Mon Feb 26 13:15:50 2018
@@ -1,5 +1,6 @@
<html>
+<title>or.c</title>
<meta charset="utf-8" />
<head>
<link rel='stylesheet' type='text/css' href='style.css'>
Modified: llvm/trunk/test/tools/opt-viewer/Outputs/basic/basic_or.h.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/opt-viewer/Outputs/basic/basic_or.h.html?rev=326125&r1=326124&r2=326125&view=diff
==============================================================================
--- llvm/trunk/test/tools/opt-viewer/Outputs/basic/basic_or.h.html (original)
+++ llvm/trunk/test/tools/opt-viewer/Outputs/basic/basic_or.h.html Mon Feb 26 13:15:50 2018
@@ -1,5 +1,6 @@
<html>
+<title>or.h</title>
<meta charset="utf-8" />
<head>
<link rel='stylesheet' type='text/css' href='style.css'>
Modified: llvm/trunk/test/tools/opt-viewer/Outputs/suppress/s.swift.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/opt-viewer/Outputs/suppress/s.swift.html?rev=326125&r1=326124&r2=326125&view=diff
==============================================================================
--- llvm/trunk/test/tools/opt-viewer/Outputs/suppress/s.swift.html (original)
+++ llvm/trunk/test/tools/opt-viewer/Outputs/suppress/s.swift.html Mon Feb 26 13:15:50 2018
@@ -1,5 +1,6 @@
<html>
+<title>s.swift</title>
<meta charset="utf-8" />
<head>
<link rel='stylesheet' type='text/css' href='style.css'>
Modified: llvm/trunk/test/tools/opt-viewer/Outputs/unicode-function-name/s.swift.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/opt-viewer/Outputs/unicode-function-name/s.swift.html?rev=326125&r1=326124&r2=326125&view=diff
==============================================================================
--- llvm/trunk/test/tools/opt-viewer/Outputs/unicode-function-name/s.swift.html (original)
+++ llvm/trunk/test/tools/opt-viewer/Outputs/unicode-function-name/s.swift.html Mon Feb 26 13:15:50 2018
@@ -1,5 +1,6 @@
<html>
+<title>s.swift</title>
<meta charset="utf-8" />
<head>
<link rel='stylesheet' type='text/css' href='style.css'>
Modified: llvm/trunk/tools/opt-viewer/opt-viewer.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt-viewer/opt-viewer.py?rev=326125&r1=326124&r2=326125&view=diff
==============================================================================
--- llvm/trunk/tools/opt-viewer/opt-viewer.py (original)
+++ llvm/trunk/tools/opt-viewer/opt-viewer.py Mon Feb 26 13:15:50 2018
@@ -44,6 +44,7 @@ def suppress(remark):
class SourceFileRenderer:
def __init__(self, source_dir, output_dir, filename, no_highlight):
+ self.filename = filename
existing_filename = None
if os.path.exists(filename):
existing_filename = filename
@@ -131,6 +132,7 @@ class SourceFileRenderer:
print('''
<html>
+<title>{}</title>
<meta charset="utf-8" />
<head>
<link rel='stylesheet' type='text/css' href='style.css'>
@@ -147,7 +149,7 @@ class SourceFileRenderer:
<th style="width: 15%">Inline Context</td>
</tr>
</thead>
-<tbody>''', file=self.stream)
+<tbody>'''.format(os.path.basename(self.filename)), file=self.stream)
self.render_source_lines(self.source_stream, line_remarks)
print('''
More information about the llvm-commits
mailing list