Index: llvm/trunk/lib/Analysis/CallGraphSCCPass.cpp =================================================================== --- llvm/trunk/lib/Analysis/CallGraphSCCPass.cpp +++ llvm/trunk/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();