OSDN Git Service

[opt-viewer] Use Python 3-compatible `intern()`
authorBrian Gesiak <modocache@gmail.com>
Fri, 11 Aug 2017 17:56:57 +0000 (17:56 +0000)
committerBrian Gesiak <modocache@gmail.com>
Fri, 11 Aug 2017 17:56:57 +0000 (17:56 +0000)
commit51d5be37337a4e6089435f49d62ef69ee91541ce
treef97644fc614e8ea7ad3cb9e466fa8541002df596
parent911c1e458f0f5070ee1d0e7c915e89de18ef4ac2
[opt-viewer] Use Python 3-compatible `intern()`

Summary:
In Python 2, `intern()` is a builtin function available to all programs.
In Python 3, it was moved into the `sys` module, available as
`sys.intern`. Import it such that, within `optrecord.py`, `intern()` is
available whether run using Python 2 or 3.

Test Plan:
Run `opt-viewer.py` using Python 3, confirm it no longer
encounters a runtime error when `intern()` is called.

Reviewers: anemet

Reviewed By: anemet

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310739 91177308-0d34-0410-b5e6-96231b3b80d8
tools/opt-viewer/optrecord.py