Skip to content

Commit 798e92c

Browse files
committed
[BOLT] Respect shouldPrint in dump-dot-all
Don't dump dot CFG graph for functions that should not be printed. Reviewed By: rafauler, maksfb Differential Revision: https://reviews.llvm.org/D128699
1 parent dee672e commit 798e92c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3110,8 +3110,12 @@ void BinaryFunction::viewGraph() const {
31103110
}
31113111

31123112
void BinaryFunction::dumpGraphForPass(std::string Annotation) const {
3113+
if (!opts::shouldPrint(*this))
3114+
return;
3115+
31133116
std::string Filename = constructFilename(getPrintName(), Annotation, ".dot");
3114-
outs() << "BOLT-DEBUG: Dumping CFG to " << Filename << "\n";
3117+
if (opts::Verbosity >= 1)
3118+
outs() << "BOLT-INFO: dumping CFG to " << Filename << "\n";
31153119
dumpGraphToFile(Filename);
31163120
}
31173121

@@ -4373,6 +4377,9 @@ DebugLocationsVector BinaryFunction::translateInputToOutputLocationList(
43734377
}
43744378

43754379
void BinaryFunction::printLoopInfo(raw_ostream &OS) const {
4380+
if (!opts::shouldPrint(*this))
4381+
return;
4382+
43764383
OS << "Loop Info for Function \"" << *this << "\"";
43774384
if (hasValidProfile())
43784385
OS << " (count: " << getExecutionCount() << ")";

0 commit comments

Comments
 (0)