This is an archive of the discontinued LLVM Phabricator instance.

[opt-viewer] Use Python 3-compatible `intern()`
ClosedPublic

Authored by modocache on Aug 11 2017, 10:15 AM.

Details

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.

Event Timeline

modocache created this revision.Aug 11 2017, 10:15 AM
anemet accepted this revision.Aug 11 2017, 10:30 AM

LGTM, assuming it still works with Python2. (I don't see why it wouldn't.)

This revision is now accepted and ready to land.Aug 11 2017, 10:30 AM

Yup, I've confirmed this still works with Python 2. Thanks, @anemet!

modocache closed this revision.Aug 11 2017, 10:57 AM