[PATCH] D34086: Fix -print-after-all banner
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 12 08:59:49 PDT 2017
I would've guessed this would be testable? Is it not?
On Sun, Jun 11, 2017 at 1:30 AM Yaron Keren via Phabricator via
llvm-commits <llvm-commits at lists.llvm.org> wrote:
> yaron.keren created this revision.
>
> Address https://bugs.llvm.org/show_bug.cgi?id=32207, banner does not
> print more than once following r292442 by making BannerPrinted local and
> skipping banner for function declarations.
>
>
> Repository:
> rL LLVM
>
> https://reviews.llvm.org/D34086
>
> Files:
> lib/Analysis/CallGraphSCCPass.cpp
>
>
> Index: lib/Analysis/CallGraphSCCPass.cpp
> ===================================================================
> --- lib/Analysis/CallGraphSCCPass.cpp
> +++ lib/Analysis/CallGraphSCCPass.cpp
> @@ -608,18 +608,18 @@
> }
>
> bool runOnSCC(CallGraphSCC &SCC) override {
> + bool BannerPrinted = false;
> auto PrintBannerOnce = [&] () {
> - static bool BannerPrinted = false;
> if (BannerPrinted)
> return;
> Out << Banner;
> BannerPrinted = true;
> };
> for (CallGraphNode *CGN : SCC) {
> - if (CGN->getFunction()) {
> - if (isFunctionInPrintList(CGN->getFunction()->getName())) {
> + if (Function *F = CGN->getFunction()) {
> + if (!F->isDeclaration() && isFunctionInPrintList(F->getName()))
> {
> PrintBannerOnce();
> - CGN->getFunction()->print(Out);
> + F->print(Out);
> }
> } else if (llvm::isFunctionInPrintList("*")) {
> PrintBannerOnce();
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170612/423dd6ab/attachment.html>
More information about the llvm-commits
mailing list