Skip to content

Commit

Permalink
Improve graph printing.
Browse files Browse the repository at this point in the history
This patch forces DynamicGraph::dump to be used and thus present in the binary
where we can use it from a debugger.
  • Loading branch information
vgvassilev committed Jan 7, 2025
1 parent 584eb31 commit 5dcaa56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/Differentiator/DiffPlanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,10 @@ namespace clad {

void DiffRequest::print(llvm::raw_ostream& Out) const {
Out << '<';
PrintingPolicy Policy(Function->getASTContext().getLangOpts());
Function->getNameForDiagnostic(Out, Policy, /*Qualified=*/true);
PrintingPolicy P(Function->getASTContext().getLangOpts());
P.TerseOutput = true;
P.FullyQualifiedName = true;
Function->print(Out, P, /*Indentation=*/0, /*PrintInstantiation=*/true);
Out << ">[name=" << BaseFunctionName << ", "
<< "order=" << CurrentDerivativeOrder << ", "
<< "mode=" << DiffModeToString(Mode);
Expand Down
2 changes: 1 addition & 1 deletion tools/ClangPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ namespace clad {

// Print the graph of the diff requests.
llvm::errs() << "\n*** INFORMATION ABOUT THE DIFF REQUESTS\n";
m_DiffRequestGraph.print(std::cerr);
m_DiffRequestGraph.dump();

m_Multiplexer->PrintStats();
}
Expand Down

0 comments on commit 5dcaa56

Please sign in to comment.