[PATCH] D33701: [coroutines] Call initializePass in coroutine pass constructors
Gor Nishanov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 30 16:08:24 PDT 2017
GorNishanov created this revision.
and skipFunction if requested.
Fixes: https://bugs.llvm.org/show_bug.cgi?id=33226
https://reviews.llvm.org/D33701
Files:
lib/Transforms/Coroutines/CoroCleanup.cpp
lib/Transforms/Coroutines/CoroEarly.cpp
lib/Transforms/Coroutines/CoroElide.cpp
lib/Transforms/Coroutines/CoroSplit.cpp
Index: lib/Transforms/Coroutines/CoroSplit.cpp
===================================================================
--- lib/Transforms/Coroutines/CoroSplit.cpp
+++ lib/Transforms/Coroutines/CoroSplit.cpp
@@ -681,7 +681,9 @@
struct CoroSplit : public CallGraphSCCPass {
static char ID; // Pass identification, replacement for typeid
- CoroSplit() : CallGraphSCCPass(ID) {}
+ CoroSplit() : CallGraphSCCPass(ID) {
+ initializeCoroSplitPass(*PassRegistry::getPassRegistry());
+ }
bool Run = false;
Index: lib/Transforms/Coroutines/CoroElide.cpp
===================================================================
--- lib/Transforms/Coroutines/CoroElide.cpp
+++ lib/Transforms/Coroutines/CoroElide.cpp
@@ -258,7 +258,9 @@
namespace {
struct CoroElide : FunctionPass {
static char ID;
- CoroElide() : FunctionPass(ID) {}
+ CoroElide() : FunctionPass(ID) {
+ initializeCoroElidePass(*PassRegistry::getPassRegistry());
+ }
std::unique_ptr<Lowerer> L;
@@ -269,7 +271,7 @@
}
bool runOnFunction(Function &F) override {
- if (!L)
+ if (!L || skipFunction(F))
return false;
bool Changed = false;
Index: lib/Transforms/Coroutines/CoroEarly.cpp
===================================================================
--- lib/Transforms/Coroutines/CoroEarly.cpp
+++ lib/Transforms/Coroutines/CoroEarly.cpp
@@ -183,7 +183,9 @@
struct CoroEarly : public FunctionPass {
static char ID; // Pass identification, replacement for typeid.
- CoroEarly() : FunctionPass(ID) {}
+ CoroEarly() : FunctionPass(ID) {
+ initializeCoroEarlyPass(*PassRegistry::getPassRegistry());
+ }
std::unique_ptr<Lowerer> L;
@@ -199,7 +201,7 @@
}
bool runOnFunction(Function &F) override {
- if (!L)
+ if (!L || skipFunction(F))
return false;
return L->lowerEarlyIntrinsics(F);
Index: lib/Transforms/Coroutines/CoroCleanup.cpp
===================================================================
--- lib/Transforms/Coroutines/CoroCleanup.cpp
+++ lib/Transforms/Coroutines/CoroCleanup.cpp
@@ -101,7 +101,9 @@
struct CoroCleanup : FunctionPass {
static char ID; // Pass identification, replacement for typeid
- CoroCleanup() : FunctionPass(ID) {}
+ CoroCleanup() : FunctionPass(ID) {
+ initializeCoroCleanupPass(*PassRegistry::getPassRegistry());
+ }
std::unique_ptr<Lowerer> L;
@@ -116,9 +118,10 @@
}
bool runOnFunction(Function &F) override {
- if (L)
- return L->lowerRemainingCoroIntrinsics(F);
- return false;
+ if (!L || skipFunction(F))
+ return false;
+
+ return L->lowerRemainingCoroIntrinsics(F);
}
void getAnalysisUsage(AnalysisUsage &AU) const override {
if (!L)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33701.100795.patch
Type: text/x-patch
Size: 2693 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170530/d1d7e48b/attachment.bin>
More information about the llvm-commits
mailing list