forked from OSchip/llvm-project
Remove WriteGraph's Name argument, which it didn't use, and
rename writeHeader's Name argument to Title, to be consistent with WriteGraph. llvm-svn: 114829
This commit is contained in:
parent
9a1b8598ef
commit
24697d3b8d
|
|
@ -67,7 +67,7 @@ struct DOTGraphTraitsPrinter : public FunctionPass {
|
||||||
Title = GraphName + " for '" + F.getNameStr() + "' function";
|
Title = GraphName + " for '" + F.getNameStr() + "' function";
|
||||||
|
|
||||||
if (ErrorInfo.empty())
|
if (ErrorInfo.empty())
|
||||||
WriteGraph(File, Graph, Simple, Name, Title);
|
WriteGraph(File, Graph, Simple, Title);
|
||||||
else
|
else
|
||||||
errs() << " error opening file for writing!";
|
errs() << " error opening file for writing!";
|
||||||
errs() << "\n";
|
errs() << "\n";
|
||||||
|
|
|
||||||
|
|
@ -92,11 +92,11 @@ public:
|
||||||
DTraits = DOTTraits(SN);
|
DTraits = DOTTraits(SN);
|
||||||
}
|
}
|
||||||
|
|
||||||
void writeHeader(const std::string &Name) {
|
void writeHeader(const std::string &Title) {
|
||||||
std::string GraphName = DTraits.getGraphName(G);
|
std::string GraphName = DTraits.getGraphName(G);
|
||||||
|
|
||||||
if (!Name.empty())
|
if (!Title.empty())
|
||||||
O << "digraph \"" << DOT::EscapeString(Name) << "\" {\n";
|
O << "digraph \"" << DOT::EscapeString(Title) << "\" {\n";
|
||||||
else if (!GraphName.empty())
|
else if (!GraphName.empty())
|
||||||
O << "digraph \"" << DOT::EscapeString(GraphName) << "\" {\n";
|
O << "digraph \"" << DOT::EscapeString(GraphName) << "\" {\n";
|
||||||
else
|
else
|
||||||
|
|
@ -105,8 +105,8 @@ public:
|
||||||
if (DTraits.renderGraphFromBottomUp())
|
if (DTraits.renderGraphFromBottomUp())
|
||||||
O << "\trankdir=\"BT\";\n";
|
O << "\trankdir=\"BT\";\n";
|
||||||
|
|
||||||
if (!Name.empty())
|
if (!Title.empty())
|
||||||
O << "\tlabel=\"" << DOT::EscapeString(Name) << "\";\n";
|
O << "\tlabel=\"" << DOT::EscapeString(Title) << "\";\n";
|
||||||
else if (!GraphName.empty())
|
else if (!GraphName.empty())
|
||||||
O << "\tlabel=\"" << DOT::EscapeString(GraphName) << "\";\n";
|
O << "\tlabel=\"" << DOT::EscapeString(GraphName) << "\";\n";
|
||||||
O << DTraits.getGraphProperties(G);
|
O << DTraits.getGraphProperties(G);
|
||||||
|
|
@ -282,7 +282,6 @@ public:
|
||||||
template<typename GraphType>
|
template<typename GraphType>
|
||||||
raw_ostream &WriteGraph(raw_ostream &O, const GraphType &G,
|
raw_ostream &WriteGraph(raw_ostream &O, const GraphType &G,
|
||||||
bool ShortNames = false,
|
bool ShortNames = false,
|
||||||
const std::string &Name = "",
|
|
||||||
const std::string &Title = "") {
|
const std::string &Title = "") {
|
||||||
// Start the graph emission process...
|
// Start the graph emission process...
|
||||||
GraphWriter<GraphType> W(O, G, ShortNames);
|
GraphWriter<GraphType> W(O, G, ShortNames);
|
||||||
|
|
@ -322,7 +321,7 @@ sys::Path WriteGraph(const GraphType &G, const std::string &Name,
|
||||||
raw_fd_ostream O(Filename.c_str(), ErrorInfo);
|
raw_fd_ostream O(Filename.c_str(), ErrorInfo);
|
||||||
|
|
||||||
if (ErrorInfo.empty()) {
|
if (ErrorInfo.empty()) {
|
||||||
llvm::WriteGraph(O, G, ShortNames, Name, Title);
|
llvm::WriteGraph(O, G, ShortNames, Title);
|
||||||
errs() << " done. \n";
|
errs() << " done. \n";
|
||||||
} else {
|
} else {
|
||||||
errs() << "error opening file '" << Filename.str() << "' for writing!\n";
|
errs() << "error opening file '" << Filename.str() << "' for writing!\n";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue