Introduce -print-changed=[diff | diff-quiet] which show changes in patch-like format
authorJamie Schmeiser <schmeise@ca.ibm.com>
Mon, 8 Feb 2021 15:09:34 +0000 (10:09 -0500)
committerJamie Schmeiser <schmeise@ca.ibm.com>
Mon, 8 Feb 2021 15:11:22 +0000 (10:11 -0500)
commit4b661b4059b0b5fa8594a0717df208a122ea15da
treec186ee0335e700271675d78071f979cd7f728330
parentc5c690a835524c91b2650f3d577be56bab8093d2
Introduce -print-changed=[diff | diff-quiet] which show changes in patch-like format
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
llvm/include/llvm/Passes/StandardInstrumentations.h
llvm/lib/Passes/StandardInstrumentations.cpp
llvm/test/Other/ChangePrinters/lit.local.cfg [new file with mode: 0644]
llvm/test/Other/ChangePrinters/print-changed-diff.ll [new file with mode: 0644]