diff options
author | Weiming Zhao <weimingz@codeaurora.org> | 2016-01-06 18:20:25 +0000 |
---|---|---|
committer | Weiming Zhao <weimingz@codeaurora.org> | 2016-01-06 18:20:25 +0000 |
commit | eac06368053bd1e7082b5ab7efcd6f9c7014d589 (patch) | |
tree | 0d07c5c52b63ddac0d8345db928893a825dd3bd2 /llvm/lib/Analysis/LoopPass.cpp | |
parent | c7c18d6d14f5d95e1a940ee4841e8ba74d8f9078 (diff) | |
download | bcm5719-llvm-eac06368053bd1e7082b5ab7efcd6f9c7014d589.tar.gz bcm5719-llvm-eac06368053bd1e7082b5ab7efcd6f9c7014d589.zip |
Filtering IR printing for print-after-all/print-before-all
Summary:
This patch implements "-print-funcs" option to support function filtering for IR printing like -print-after-all, -print-before etc.
Examples:
-print-after-all -print-funcs=foo,bar
Reviewers: mcrosier, joker.eph
Subscribers: tejohnson, joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D15776
llvm-svn: 256952
Diffstat (limited to 'llvm/lib/Analysis/LoopPass.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopPass.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp index dc424734dd5..e24a9e46fc1 100644 --- a/llvm/lib/Analysis/LoopPass.cpp +++ b/llvm/lib/Analysis/LoopPass.cpp @@ -42,7 +42,11 @@ public: } bool runOnLoop(Loop *L, LPPassManager &) override { - P.run(*L); + auto BBI = find_if(L->blocks().begin(), L->blocks().end(), + [](BasicBlock *BB) { return BB; }); + if (BBI != L->blocks().end() && + isFunctionInPrintList((*BBI)->getParent()->getName())) + P.run(*L); return false; } }; |