[all-commits] [llvm/llvm-project] 621efa: [NFC intended] Refactor the code for printChanged ...

jamieschmeiser via All-commits all-commits at lists.llvm.org
Fri Nov 20 06:51:21 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 621efa6a5a964d72ad3f1d34776aad476ae2a2e3
      https://github.com/llvm/llvm-project/commit/621efa6a5a964d72ad3f1d34776aad476ae2a2e3
  Author: Jamie Schmeiser <schmeise at ca.ibm.com>
  Date:   2020-11-20 (Fri, 20 Nov 2020)

  Changed paths:
    M llvm/include/llvm/Passes/StandardInstrumentations.h
    M llvm/lib/Passes/StandardInstrumentations.cpp

  Log Message:
  -----------
  [NFC intended] Refactor the code for printChanged for reuse and to facilitate subsequent reporters of changes to the IR in the new pass manager.

Summary:
[NFC intended] Refactor the code for printChanged for reuse and to facilitate
subsequent reporters of changes to the IR in the new pass manager.

Create abstract template base classes for common functionality and give
classes more appropriate names.  The base classes handle all of the
determination of when a function or pass is "interesting" and should be
reported or filtered out. They have pure virtual functions which are called
when a change by a pass has been recognized so the derived class need only
provide the overrides to present the information about the changing IR.
There are at least 2 more change reporters to come (which were presented
in my tutorial at the 2020 llvm developer's meeting) that derive from
these classes.

Respond to review comments:  move function out of line, remove inline keyword,
remove unneeded qualifiers, simplify comparison.

Author: Jamie Schmeiser <schmeise at ca.ibm.com>
Reviewed By: aeubanks (Arthur Eubanks), madhur13490 (Madhur Amilkanthwar)
Differential Revision: https://reviews.llvm.org/D87000




More information about the All-commits mailing list