1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/tools/opt-viewer
Brian Gesiak fc0ef13c37 [opt-viewer] Decode HTML bytes for Python 3
Summary:
When using Python 3, `pygments.highlight()` returns a `bytes` object, not
a `str`, causing the call to `str.replace` on the following line to fail
with a runtime exception:
`TypeError: 'str' does not support the buffer interface`. Decode the
bytes into a string in order to fix the exception.

Test Plan:
Run `opt-viewer.py` with Python 3.4, and confirm no runtime error occurs
when calling `str.replace`.

Reviewers: anemet

Reviewed By: anemet

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D36624

llvm-svn: 310741
2017-08-11 18:05:26 +00:00
..
CMakeLists.txt
opt-diff.py [opt-viewer] Reduce memory consumption by another 20-25% 2017-07-19 22:04:59 +00:00
opt-stats.py [opt-viewer] Print allocated memory per remark in opt-stats.py 2017-07-19 22:04:58 +00:00
opt-viewer.py [opt-viewer] Decode HTML bytes for Python 3 2017-08-11 18:05:26 +00:00
optpmap.py [opt-viewer] Flush stdout after progress update 2017-07-14 04:54:26 +00:00
optrecord.py [opt-viewer] Use Python 3-compatible iteritems 2017-08-11 18:02:07 +00:00
style.css