LLVM 22.0.0git
llvm::GraphWriterBase< GraphType, Derived > Class Template Reference

#include "llvm/Support/GraphWriter.h"

Inheritance diagram for llvm::GraphWriterBase< GraphType, Derived >:
[legend]

Public Member Functions

 GraphWriterBase (raw_ostream &o, const GraphType &g, bool SN)
virtual ~GraphWriterBase ()
void writeGraph (const std::string &Title="")
void writeHeader (const std::string &Title)
void writeFooter ()
void writeNodes ()
bool isNodeHidden (NodeRef Node)
void writeNode (NodeRef Node)
void writeEdge (NodeRef Node, unsigned edgeidx, child_iterator EI)
void emitSimpleNode (const void *ID, const std::string &Attr, const std::string &Label, unsigned NumEdgeSources=0, const std::vector< std::string > *EdgeSourceLabels=nullptr)
 emitSimpleNode - Outputs a simple (non-record) node
void emitEdge (const void *SrcNodeID, int SrcNodePort, const void *DestNodeID, int DestNodePort, const std::string &Attrs)
 emitEdge - Output an edge from a simple node into the graph...
raw_ostreamgetOStream ()
 getOStream - Get the raw output stream into the graph file.

Protected Types

using DOTTraits = DOTGraphTraits<GraphType>
using GTraits = GraphTraits<GraphType>
using NodeRef = typename GTraits::NodeRef
using node_iterator = typename GTraits::nodes_iterator
using child_iterator = typename GTraits::ChildIteratorType

Protected Member Functions

Derived & getDerived ()
const Derived & getDerived () const
bool getEdgeSourceLabels (raw_ostream &O, NodeRef Node)

Protected Attributes

raw_ostreamO
const GraphType & G
bool RenderUsingHTML = false
DOTTraits DTraits

Detailed Description

template<typename GraphType, typename Derived>
class llvm::GraphWriterBase< GraphType, Derived >

Definition at line 64 of file GraphWriter.h.

Member Typedef Documentation

◆ child_iterator

template<typename GraphType, typename Derived>
using llvm::GraphWriterBase< GraphType, Derived >::child_iterator = typename GTraits::ChildIteratorType
protected

Definition at line 74 of file GraphWriter.h.

◆ DOTTraits

template<typename GraphType, typename Derived>
using llvm::GraphWriterBase< GraphType, Derived >::DOTTraits = DOTGraphTraits<GraphType>
protected

Definition at line 70 of file GraphWriter.h.

◆ GTraits

template<typename GraphType, typename Derived>
using llvm::GraphWriterBase< GraphType, Derived >::GTraits = GraphTraits<GraphType>
protected

Definition at line 71 of file GraphWriter.h.

◆ node_iterator

template<typename GraphType, typename Derived>
using llvm::GraphWriterBase< GraphType, Derived >::node_iterator = typename GTraits::nodes_iterator
protected

Definition at line 73 of file GraphWriter.h.

◆ NodeRef

template<typename GraphType, typename Derived>
using llvm::GraphWriterBase< GraphType, Derived >::NodeRef = typename GTraits::NodeRef
protected

Definition at line 72 of file GraphWriter.h.

Constructor & Destructor Documentation

◆ GraphWriterBase()

template<typename GraphType, typename Derived>
llvm::GraphWriterBase< GraphType, Derived >::GraphWriterBase ( raw_ostream & o,
const GraphType & g,
bool SN )
inline

Definition at line 127 of file GraphWriter.h.

References DTraits, G, g(), O, and RenderUsingHTML.

◆ ~GraphWriterBase()

template<typename GraphType, typename Derived>
virtual llvm::GraphWriterBase< GraphType, Derived >::~GraphWriterBase ( )
inlinevirtual

Definition at line 131 of file GraphWriter.h.

Member Function Documentation

◆ emitEdge()

template<typename GraphType, typename Derived>
void llvm::GraphWriterBase< GraphType, Derived >::emitEdge ( const void * SrcNodeID,
int SrcNodePort,
const void * DestNodeID,
int DestNodePort,
const std::string & Attrs )
inline

emitEdge - Output an edge from a simple node into the graph...

Definition at line 342 of file GraphWriter.h.

References DTraits, and O.

Referenced by llvm::DOTGraphTraits< SelectionDAG * >::addCustomGraphFeatures(), and llvm::ScheduleDAGSDNodes::getCustomGraphFeatures().

◆ emitSimpleNode()

template<typename GraphType, typename Derived>
void llvm::GraphWriterBase< GraphType, Derived >::emitSimpleNode ( const void * ID,
const std::string & Attr,
const std::string & Label,
unsigned NumEdgeSources = 0,
const std::vector< std::string > * EdgeSourceLabels = nullptr )
inline

emitSimpleNode - Outputs a simple (non-record) node

Definition at line 319 of file GraphWriter.h.

References llvm::DOT::EscapeString(), and O.

Referenced by llvm::DOTGraphTraits< SelectionDAG * >::addCustomGraphFeatures(), and llvm::ScheduleDAGSDNodes::getCustomGraphFeatures().

◆ getDerived() [1/2]

template<typename GraphType, typename Derived>
Derived & llvm::GraphWriterBase< GraphType, Derived >::getDerived ( )
inlineprotected

Definition at line 83 of file GraphWriter.h.

Referenced by writeEdge(), writeGraph(), and writeNodes().

◆ getDerived() [2/2]

template<typename GraphType, typename Derived>
const Derived & llvm::GraphWriterBase< GraphType, Derived >::getDerived ( ) const
inlineprotected

Definition at line 84 of file GraphWriter.h.

◆ getEdgeSourceLabels()

template<typename GraphType, typename Derived>
bool llvm::GraphWriterBase< GraphType, Derived >::getEdgeSourceLabels ( raw_ostream & O,
NodeRef Node )
inlineprotected

Definition at line 90 of file GraphWriter.h.

References DTraits, llvm::DOT::EscapeString(), O, and RenderUsingHTML.

Referenced by writeNode().

◆ getOStream()

template<typename GraphType, typename Derived>
raw_ostream & llvm::GraphWriterBase< GraphType, Derived >::getOStream ( )
inline

getOStream - Get the raw output stream into the graph file.

Useful to write fancy things using addCustomGraphFeatures().

Definition at line 362 of file GraphWriter.h.

References O.

Referenced by llvm::DOTGraphTraits< RegionInfo * >::addCustomGraphFeatures(), and llvm::DOTGraphTraits< RegionInfo * >::printRegionCluster().

◆ isNodeHidden()

template<typename GraphType, typename Derived>
bool llvm::GraphWriterBase< GraphType, Derived >::isNodeHidden ( NodeRef Node)
inline

Definition at line 180 of file GraphWriter.h.

References DTraits, and G.

Referenced by writeNodes().

◆ writeEdge()

template<typename GraphType, typename Derived>
void llvm::GraphWriterBase< GraphType, Derived >::writeEdge ( NodeRef Node,
unsigned edgeidx,
child_iterator EI )
inline

Definition at line 297 of file GraphWriter.h.

References DTraits, G, getDerived(), and llvm::Offset.

Referenced by writeNode().

◆ writeFooter()

template<typename GraphType, typename Derived>
void llvm::GraphWriterBase< GraphType, Derived >::writeFooter ( )
inline

Definition at line 168 of file GraphWriter.h.

References O.

◆ writeGraph()

template<typename GraphType, typename Derived>
void llvm::GraphWriterBase< GraphType, Derived >::writeGraph ( const std::string & Title = "")
inline

◆ writeHeader()

template<typename GraphType, typename Derived>
void llvm::GraphWriterBase< GraphType, Derived >::writeHeader ( const std::string & Title)
inline

Definition at line 147 of file GraphWriter.h.

References DTraits, llvm::DOT::EscapeString(), G, and O.

◆ writeNode()

template<typename GraphType, typename Derived>
void llvm::GraphWriterBase< GraphType, Derived >::writeNode ( NodeRef Node)
inline

◆ writeNodes()

template<typename GraphType, typename Derived>
void llvm::GraphWriterBase< GraphType, Derived >::writeNodes ( )
inline

Definition at line 173 of file GraphWriter.h.

References G, getDerived(), isNodeHidden(), and llvm::nodes().

Member Data Documentation

◆ DTraits

template<typename GraphType, typename Derived>
DOTTraits llvm::GraphWriterBase< GraphType, Derived >::DTraits
protected

◆ G

template<typename GraphType, typename Derived>
const GraphType& llvm::GraphWriterBase< GraphType, Derived >::G
protected

◆ O

template<typename GraphType, typename Derived>
raw_ostream& llvm::GraphWriterBase< GraphType, Derived >::O
protected

◆ RenderUsingHTML

template<typename GraphType, typename Derived>
bool llvm::GraphWriterBase< GraphType, Derived >::RenderUsingHTML = false
protected

Definition at line 68 of file GraphWriter.h.

Referenced by getEdgeSourceLabels(), GraphWriterBase(), and writeNode().


The documentation for this class was generated from the following file: