mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
a6930617fe
Summary: Introduce base classes that hold a textual represent of the IR based on basic blocks and a base class for comparing this representation. A new change printer is introduced that uses these classes to save and compare representations of the IR before and after each pass. It only reports when changes are made by a pass (similar to -print-changed) except that the changes are shown in a patch-like format with those lines that are removed shown in red prefixed with '-' and those added shown in green with '+'. This functionality was introduced in my tutorial at the 2020 virtual developer's meeting. Author: Jamie Schmeiser <schmeise@ca.ibm.com> Reviewed By: aeubanks (Arthur Eubanks) Differential Revision: https://reviews.llvm.org/D91890
17 lines
400 B
INI
17 lines
400 B
INI
import os
|
|
import subprocess
|
|
|
|
def have_needed_diff_support():
|
|
if not os.path.exists('/usr/bin/diff'):
|
|
return False
|
|
|
|
ld_cmd = subprocess.Popen(
|
|
['/usr/bin/diff', '--help'], stdout=subprocess.PIPE, env={'LANG': 'C'})
|
|
ld_out = ld_cmd.stdout.read().decode()
|
|
ld_cmd.wait()
|
|
|
|
return '-line-format' in ld_out
|
|
|
|
if not have_needed_diff_support():
|
|
config.unsupported = True
|