mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
Disallow multiple edges.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60127 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user