[llvm] 79a1f3e - [NFC] Cleanup StandardInstrumentations
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 7 16:27:24 PST 2022
Author: Arthur Eubanks
Date: 2022-03-07T16:24:36-08:00
New Revision: 79a1f3e7c6d338b953b4dfe8cd7cb13ba60fe4e7
URL: https://github.com/llvm/llvm-project/commit/79a1f3e7c6d338b953b4dfe8cd7cb13ba60fe4e7
DIFF: https://github.com/llvm/llvm-project/commit/79a1f3e7c6d338b953b4dfe8cd7cb13ba60fe4e7.diff
LOG: [NFC] Cleanup StandardInstrumentations
Added:
Modified:
llvm/include/llvm/Passes/StandardInstrumentations.h
llvm/lib/Passes/StandardInstrumentations.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Passes/StandardInstrumentations.h b/llvm/include/llvm/Passes/StandardInstrumentations.h
index 561cd54fa9987..4438bdb00717c 100644
--- a/llvm/include/llvm/Passes/StandardInstrumentations.h
+++ b/llvm/include/llvm/Passes/StandardInstrumentations.h
@@ -187,17 +187,6 @@ template <typename IRUnitT> class ChangeReporter {
// Register required callbacks.
void registerRequiredCallbacks(PassInstrumentationCallbacks &PIC);
- // Return true when this is a defined function for which printing
- // of changes is desired.
- bool isInterestingFunction(const Function &F);
-
- // Return true when this is a pass for which printing of changes is desired.
- bool isInterestingPass(StringRef PassID);
-
- // Return true when this is a pass on IR for which printing
- // of changes is desired.
- bool isInteresting(Any IR, StringRef PassID);
-
// Called on the first IR processed.
virtual void handleInitialIR(Any IR) = 0;
// Called before and after a pass to get the representation of the IR.
diff --git a/llvm/lib/Passes/StandardInstrumentations.cpp b/llvm/lib/Passes/StandardInstrumentations.cpp
index a8d6578793b39..8221b359a738f 100644
--- a/llvm/lib/Passes/StandardInstrumentations.cpp
+++ b/llvm/lib/Passes/StandardInstrumentations.cpp
@@ -440,19 +440,11 @@ const Module *getModuleForComparison(Any IR) {
return nullptr;
}
-} // namespace
-
-template <typename T> ChangeReporter<T>::~ChangeReporter() {
- assert(BeforeStack.empty() && "Problem with Change Printer stack.");
-}
-
-template <typename T>
-bool ChangeReporter<T>::isInterestingFunction(const Function &F) {
+bool isInterestingFunction(const Function &F) {
return isFunctionInPrintList(F.getName());
}
-template <typename T>
-bool ChangeReporter<T>::isInterestingPass(StringRef PassID) {
+bool isInterestingPass(StringRef PassID) {
if (isIgnored(PassID))
return false;
@@ -463,8 +455,7 @@ bool ChangeReporter<T>::isInterestingPass(StringRef PassID) {
// Return true when this is a pass on IR for which printing
// of changes is desired.
-template <typename T>
-bool ChangeReporter<T>::isInteresting(Any IR, StringRef PassID) {
+bool isInteresting(Any IR, StringRef PassID) {
if (!isInterestingPass(PassID))
return false;
if (any_isa<const Function *>(IR))
@@ -472,6 +463,12 @@ bool ChangeReporter<T>::isInteresting(Any IR, StringRef PassID) {
return true;
}
+} // namespace
+
+template <typename T> ChangeReporter<T>::~ChangeReporter<T>() {
+ assert(BeforeStack.empty() && "Problem with Change Printer stack.");
+}
+
template <typename T>
void ChangeReporter<T>::saveIRBeforePass(Any IR, StringRef PassID) {
// Always need to place something on the stack because invalidated passes
More information about the llvm-commits
mailing list