forked from OSchip/llvm-project
Address http://bugs.llvm.org/pr32207 by making BannerPrinted local to runOnSCC and skipping banner for function declarations.
Reviewed By: Mehdi AMINI Differential Revision: https://reviews.llvm.org/D34086 llvm-svn: 305179
This commit is contained in:
parent
dffec3d678
commit
7d46392124
|
@ -608,18 +608,18 @@ namespace {
|
|||
}
|
||||
|
||||
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();
|
||||
|
|
Loading…
Reference in New Issue