diff options
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp | 34 | 
1 files changed, 19 insertions, 15 deletions
| diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp index ccc5e3c75c99..c5adc5000dba 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp @@ -35,6 +35,9 @@ using namespace llvm;  namespace llvm {    template<>    struct DOTGraphTraits<SelectionDAG*> : public DefaultDOTGraphTraits { + +    DOTGraphTraits (bool isSimple=false) : DefaultDOTGraphTraits(isSimple) {} +      static bool hasEdgeDestLabels() {        return true;      } @@ -48,8 +51,8 @@ namespace llvm {      }      /// edgeTargetsEdgeSource - This method returns true if this outgoing edge -    /// should actually target another edge source, not a node.  If this method is -    /// implemented, getEdgeTarget should be implemented. +    /// should actually target another edge source, not a node.  If this method +    /// is implemented, getEdgeTarget should be implemented.      template<typename EdgeIter>      static bool edgeTargetsEdgeSource(const void *Node, EdgeIter I) {        return true; @@ -93,9 +96,16 @@ namespace llvm {      } -    static std::string getNodeLabel(const SDNode *Node, -                                    const SelectionDAG *Graph, -                                    bool ShortNames); +    static std::string getSimpleNodeLabel(const SDNode *Node, +                                          const SelectionDAG *G) { +      std::string Result = Node->getOperationName(G); +      { +        raw_string_ostream OS(Result); +        Node->print_details(OS, G); +      } +      return Result; +    } +    std::string getNodeLabel(const SDNode *Node, const SelectionDAG *Graph);      static std::string getNodeAttributes(const SDNode *N,                                           const SelectionDAG *Graph) {  #ifndef NDEBUG @@ -121,14 +131,8 @@ namespace llvm {  }  std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node, -                                                        const SelectionDAG *G, -                                                        bool ShortNames) { -  std::string Result = Node->getOperationName(G); -  { -    raw_string_ostream OS(Result); -    Node->print_details(OS, G); -  } -  return Result; +                                                        const SelectionDAG *G) { +  return DOTGraphTraits<SelectionDAG*>::getSimpleNodeLabel (Node, G);  } @@ -269,8 +273,8 @@ std::string ScheduleDAGSDNodes::getGraphNodeLabel(const SUnit *SU) const {      for (SDNode *N = SU->getNode(); N; N = N->getFlaggedNode())        FlaggedNodes.push_back(N);      while (!FlaggedNodes.empty()) { -      O << DOTGraphTraits<SelectionDAG*>::getNodeLabel(FlaggedNodes.back(), -                                                       DAG, false); +      O << DOTGraphTraits<SelectionDAG*> +	     ::getSimpleNodeLabel(FlaggedNodes.back(), DAG);        FlaggedNodes.pop_back();        if (!FlaggedNodes.empty())          O << "\n    "; | 
