[PATCH] D87000: [NFC intended] Refactor code for print-changed to facilitate reuse.
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 5 09:56:29 PST 2020
aeubanks added a comment.
lg aside from some nits
================
Comment at: llvm/include/llvm/Passes/StandardInstrumentations.h:157
+ // Register required callbacks.
+ void registerRequiredCallbacks(llvm::PassInstrumentationCallbacks &PIC) {
+ PIC.registerBeforePassCallback([this](llvm::StringRef P, llvm::Any IR) {
----------------
can you move the definition to the .cpp file? Also, the `llvm::` namespace shouldn't be necessary (throughout this entire patch)
================
Comment at: llvm/include/llvm/Passes/StandardInstrumentations.h:174
+ // of changes is desired.
+ inline bool isInterestingFunction(const llvm::Function &F);
+
----------------
are the `inline`s necessary?
================
Comment at: llvm/lib/Passes/StandardInstrumentations.cpp:418
+bool IRChangedPrinter::same(const std::string &S1, const std::string &S2) {
+ return S1.compare(S2) == 0;
}
----------------
`Before == After` seems simpler
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87000/new/
https://reviews.llvm.org/D87000
More information about the llvm-commits
mailing list