diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2008-05-06 16:36:06 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2008-05-06 16:36:06 +0000 |
commit | 0a174930e25ff59dd0181beedae1b47d85265ece (patch) | |
tree | 254e5e58381f74bb0ad3444996f5c34e1573302e /tools/llvmc2/CompilationGraph.cpp | |
parent | 0d08db03459b088a094d791c4a68b37d810c365c (diff) |
Ongoing work: add an edge typechecker, rudimentary support for edge properties.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50725 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvmc2/CompilationGraph.cpp')
-rw-r--r-- | tools/llvmc2/CompilationGraph.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/llvmc2/CompilationGraph.cpp b/tools/llvmc2/CompilationGraph.cpp index bff1aa5627..07b09e7390 100644 --- a/tools/llvmc2/CompilationGraph.cpp +++ b/tools/llvmc2/CompilationGraph.cpp @@ -60,7 +60,7 @@ CompilationGraph::getToolsVector(const std::string& LangName) const return I->second; } -void CompilationGraph::insertVertex(const IntrusiveRefCntPtr<Tool> V) { +void CompilationGraph::insertNode(Tool* V) { if (!NodesMap.count(V->Name())) { Node N; N.OwningGraph = this; @@ -82,13 +82,13 @@ void CompilationGraph::insertEdge(const std::string& A, ToolsMap[InputLanguage].push_back(B); // Needed to support iteration via GraphTraits. - NodesMap["root"].Children.push_back(B); + NodesMap["root"].AddEdge(new DefaultEdge(B)); } else { - Node& NA = getNode(A); + Node& N = getNode(A); // Check that there is a node at B. getNode(B); - NA.Children.push_back(B); + N.AddEdge(new DefaultEdge(B)); } } @@ -123,7 +123,7 @@ int CompilationGraph::Build (const sys::Path& tempDir) const { } // Is this the last tool? - if (N->Children.empty() || CurTool->IsLast()) { + if (!N->HasChildren() || CurTool->IsLast()) { Out.appendComponent(In.getBasename()); Out.appendSuffix(CurTool->OutputSuffix()); Last = true; @@ -139,7 +139,7 @@ int CompilationGraph::Build (const sys::Path& tempDir) const { if (CurTool->GenerateAction(In, Out).Execute() != 0) throw std::runtime_error("Tool returned error code!"); - N = &getNode(*N->Children.begin()); + N = &getNode((*N->EdgesBegin())->ToolName()); In = Out; Out.clear(); } } |