LLVM API Documentation

llvmc::CompilationGraph Class Reference

CompilationGraph - The compilation graph itself. More...

#include <CompilationGraph.h>

Collaboration diagram for llvmc::CompilationGraph:
[legend]

List of all members.

Public Types

typedef nodes_map_type::iterator nodes_iterator
typedef
nodes_map_type::const_iterator 
const_nodes_iterator

Public Member Functions

 CompilationGraph ()
void insertNode (Tool *T)
void insertEdge (const std::string &A, Edge *E)
int Build (llvm::sys::Path const &TempDir, const LanguageMap &LangMap)
int Check ()
Node & getNode (const std::string &ToolName)
const Node & getNode (const std::string &ToolName) const
void viewGraph ()
void writeGraph (const std::string &OutputFilename)
 writeGraph - Write Graphviz .dot source file to the current direcotry.

Friends

NodesIterator GraphBegin (CompilationGraph *)
NodesIterator GraphEnd (CompilationGraph *)


Detailed Description

CompilationGraph - The compilation graph itself.

Definition at line 108 of file CompilationGraph.h.


Member Typedef Documentation

Definition at line 126 of file CompilationGraph.h.

Definition at line 127 of file CompilationGraph.h.


Constructor & Destructor Documentation

CompilationGraph::CompilationGraph (  ) 

Definition at line 94 of file CompilationGraph.cpp.

References Node.


Member Function Documentation

void CompilationGraph::insertNode ( Tool *  T  ) 

insertNode - Insert a new node into the graph. Takes ownership of the object.

Definition at line 123 of file CompilationGraph.cpp.

References llvm::StringMap< ValueTy, AllocatorTy >::count(), llvmc::Tool::Name(), and Node.

void CompilationGraph::insertEdge ( const std::string &  A,
Edge *  E 
)

insertEdge - Insert a new edge into the graph. Takes ownership of the Edge object.

Definition at line 128 of file CompilationGraph.cpp.

References llvmc::Node::AddEdge(), getNode(), llvmc::Node::IncrInEdges(), llvmc::Edge::ToolName(), and llvmc::Node::ToolPtr.

int CompilationGraph::Build ( llvm::sys::Path const &  TempDir,
const LanguageMap &  LangMap 
)

Build - Build target(s) from the input file set. Command-line options are passed implicitly as global variables.

Definition at line 295 of file CompilationGraph.cpp.

References ChooseEdge(), llvmc::Action::Execute(), llvmc::JoinTool::GenerateAction(), getNode(), llvmc::Node::HasChildren(), llvmc::JoinTool::JoinListEmpty(), llvmc::Node::Name(), llvmc::Node::OutEdges, llvmc::Action::OutFile(), llvmc::Action::StopCompilation(), and llvmc::Node::ToolPtr.

Referenced by BuildTargets().

int CompilationGraph::Check (  ) 

Check - Check the compilation graph for common errors like cycles, input/output language mismatch and multiple default edges. Prints error messages and in case it finds any errors.

Definition at line 451 of file CompilationGraph.cpp.

Referenced by llvmc::Main().

Node & CompilationGraph::getNode ( const std::string &  ToolName  ) 

const Node & CompilationGraph::getNode ( const std::string &  ToolName  )  const

void CompilationGraph::viewGraph (  ) 

viewGraph - This function is meant for use from the debugger. You can just say 'call G->viewGraph()' and a ghostview window should pop up from the program, displaying the compilation graph. This depends on there being a 'dot' and 'gv' program in your path.

Definition at line 531 of file CompilationGraph.cpp.

References llvm::ViewGraph().

Referenced by llvmc::Main().

void CompilationGraph::writeGraph ( const std::string &  OutputFilename  ) 

writeGraph - Write Graphviz .dot source file to the current direcotry.

Definition at line 516 of file CompilationGraph.cpp.

References llvm::errs(), llvm::SystemZCC::O, and llvm::WriteGraph().

Referenced by llvmc::Main().


Friends And Related Function Documentation

NodesIterator GraphBegin ( CompilationGraph *  G  )  [friend]

Definition at line 235 of file CompilationGraph.h.

NodesIterator GraphEnd ( CompilationGraph *  G  )  [friend]

Definition at line 239 of file CompilationGraph.h.


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