diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2008-11-26 22:59:45 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2008-11-26 22:59:45 +0000 |
commit | 4f82fda2f1091516f8762407e26e4527d54e2f7f (patch) | |
tree | 9201c6502cff23ccb0d2aa6bd8ffc1173140e64c /tools/llvmc/driver | |
parent | ef04e01b661f58ca312d2fe582ba1eedd37c05ba (diff) | |
download | external_llvm-4f82fda2f1091516f8762407e26e4527d54e2f7f.zip external_llvm-4f82fda2f1091516f8762407e26e4527d54e2f7f.tar.gz external_llvm-4f82fda2f1091516f8762407e26e4527d54e2f7f.tar.bz2 |
Disallow multiple edges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60127 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvmc/driver')
-rw-r--r-- | tools/llvmc/driver/CompilationGraph.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/llvmc/driver/CompilationGraph.cpp b/tools/llvmc/driver/CompilationGraph.cpp index 81283ba..a4fda48 100644 --- a/tools/llvmc/driver/CompilationGraph.cpp +++ b/tools/llvmc/driver/CompilationGraph.cpp @@ -79,6 +79,20 @@ namespace { } +void Node::AddEdge(Edge* Edg) { + // If there already was an edge between two nodes, modify it instead + // of adding a new edge. + const std::string& ToolName = Edg->ToolName(); + for (container_type::iterator B = OutEdges.begin(), E = OutEdges.end(); + B != E; ++B) { + if ((*B)->ToolName() == ToolName) { + llvm::IntrusiveRefCntPtr<Edge>(Edg).swap(*B); + return; + } + } + OutEdges.push_back(llvm::IntrusiveRefCntPtr<Edge>(Edg)); +} + CompilationGraph::CompilationGraph() { NodesMap["root"] = Node(this); } |