X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FSupport%2FGraphWriter.h;h=85cf71805fd69fa8e905dff2bc9d7df56e47e046;hb=80a75bfae980df96f969f1c05b0c4a80ce975240;hp=b4e6d845e61f56876517e3bac5e605c5e15e0789;hpb=ec20402c90b605afeedbcf0e3aabe6f8054f23dd;p=oota-llvm.git diff --git a/include/llvm/Support/GraphWriter.h b/include/llvm/Support/GraphWriter.h index b4e6d845e61..85cf71805fd 100644 --- a/include/llvm/Support/GraphWriter.h +++ b/include/llvm/Support/GraphWriter.h @@ -23,12 +23,12 @@ #ifndef LLVM_SUPPORT_GRAPHWRITER_H #define LLVM_SUPPORT_GRAPHWRITER_H +#include "llvm/Support/Debug.h" #include "llvm/Support/DOTGraphTraits.h" #include "llvm/ADT/GraphTraits.h" #include "llvm/System/Path.h" -#include -#include #include +#include namespace llvm { @@ -52,7 +52,7 @@ namespace DOT { // Private functions... break; // don't disturb \l case '{': case '}': case '<': case '>': - case '"': + case '|': case '"': Str.insert(Str.begin()+i, '\\'); // Escape character... ++i; // don't infinite loop break; @@ -101,7 +101,11 @@ public: // Loop over the graph, printing it out... for (node_iterator I = GTraits::nodes_begin(G), E = GTraits::nodes_end(G); I != E; ++I) - writeNode(&*I); + writeNode(*I); + } + + void writeNode(NodeType& Node) { + writeNode(&Node); } void writeNode(NodeType *const *Node) { @@ -247,16 +251,16 @@ sys::Path WriteGraph(const GraphType &G, std::string ErrMsg; sys::Path Filename = sys::Path::GetTemporaryDirectory(&ErrMsg); if (Filename.isEmpty()) { - std::cerr << "Error: " << ErrMsg << "\n"; + cerr << "Error: " << ErrMsg << "\n"; return Filename; } Filename.appendComponent(Name + ".dot"); if (Filename.makeUnique(true,&ErrMsg)) { - std::cerr << "Error: " << ErrMsg << "\n"; + cerr << "Error: " << ErrMsg << "\n"; return sys::Path(); } - std::cerr << "Writing '" << Filename << "'... "; + cerr << "Writing '" << Filename << "'... "; std::ofstream O(Filename.c_str()); @@ -275,12 +279,12 @@ sys::Path WriteGraph(const GraphType &G, // Output the end of the graph W.writeFooter(); - std::cerr << " done. \n"; + cerr << " done. \n"; O.close(); } else { - std::cerr << "error opening file for writing!\n"; + cerr << "error opening file for writing!\n"; Filename.clear(); }