[PATCH] D94283: [NewPM] Don't error when there's an unrecognized pass name
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 7 22:33:50 PST 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG69cf7350628a: [NewPM] Don't error when there's an unrecognized pass name (authored by aeubanks).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94283/new/
https://reviews.llvm.org/D94283
Files:
llvm/include/llvm/IR/PassInstrumentation.h
llvm/lib/IR/PassInstrumentation.cpp
llvm/lib/Passes/PassBuilder.cpp
llvm/test/Other/print-before-after.ll
Index: llvm/test/Other/print-before-after.ll
===================================================================
--- llvm/test/Other/print-before-after.ll
+++ llvm/test/Other/print-before-after.ll
@@ -1,5 +1,5 @@
-; RUN: not --crash opt < %s -disable-output -passes='no-op-module' -print-before=bleh 2>&1 | FileCheck %s --check-prefix=NONE --allow-empty
-; RUN: not --crash opt < %s -disable-output -passes='no-op-module' -print-after=bleh 2>&1 | FileCheck %s --check-prefix=NONE --allow-empty
+; RUN: opt < %s -disable-output -passes='no-op-module' -print-before=bleh 2>&1 | FileCheck %s --check-prefix=NONE --allow-empty
+; RUN: opt < %s -disable-output -passes='no-op-module' -print-after=bleh 2>&1 | FileCheck %s --check-prefix=NONE --allow-empty
; RUN: opt < %s -disable-output -passes='no-op-module' -print-before=no-op-function 2>&1 | FileCheck %s --check-prefix=NONE --allow-empty
; RUN: opt < %s -disable-output -passes='no-op-module' -print-after=no-op-function 2>&1 | FileCheck %s --check-prefix=NONE --allow-empty
; RUN: opt < %s -disable-output -passes='no-op-module,no-op-function' -print-before=no-op-module 2>&1 | FileCheck %s --check-prefix=ONCE
Index: llvm/lib/Passes/PassBuilder.cpp
===================================================================
--- llvm/lib/Passes/PassBuilder.cpp
+++ llvm/lib/Passes/PassBuilder.cpp
@@ -459,14 +459,6 @@
#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME);
#include "PassRegistry.def"
- for (const auto &P : printBeforePasses()) {
- if (!PIC->hasPassName(P))
- report_fatal_error("unrecognized pass name: " + P);
- }
- for (const auto &P : printAfterPasses()) {
- if (!PIC->hasPassName(P))
- report_fatal_error("unrecognized pass name: " + P);
- }
}
}
Index: llvm/lib/IR/PassInstrumentation.cpp
===================================================================
--- llvm/lib/IR/PassInstrumentation.cpp
+++ llvm/lib/IR/PassInstrumentation.cpp
@@ -22,14 +22,6 @@
ClassToPassName[ClassName] = PassName.str();
}
-bool PassInstrumentationCallbacks::hasPassName(StringRef PassName) {
- for (const auto &E : ClassToPassName) {
- if (E.getValue() == PassName)
- return true;
- }
- return false;
-}
-
StringRef
PassInstrumentationCallbacks::getPassNameForClassName(StringRef ClassName) {
return ClassToPassName[ClassName];
Index: llvm/include/llvm/IR/PassInstrumentation.h
===================================================================
--- llvm/include/llvm/IR/PassInstrumentation.h
+++ llvm/include/llvm/IR/PassInstrumentation.h
@@ -127,8 +127,6 @@
void addClassToPassName(StringRef ClassName, StringRef PassName);
/// Get the pass name for a given pass class name.
StringRef getPassNameForClassName(StringRef ClassName);
- /// Whether or not the class to pass name map contains the pass name.
- bool hasPassName(StringRef PassName);
private:
friend class PassInstrumentation;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94283.315301.patch
Type: text/x-patch
Size: 3013 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210108/bad33326/attachment.bin>
More information about the llvm-commits
mailing list