Make ChooseEdge more generic and use it to choose between different toolchains.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50741 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/llvmc2/CompilationGraph.h b/tools/llvmc2/CompilationGraph.h
index b7f5d8e..bf97857 100644
--- a/tools/llvmc2/CompilationGraph.h
+++ b/tools/llvmc2/CompilationGraph.h
@@ -69,9 +69,6 @@
     iterator EdgesEnd() { return OutEdges.end(); }
     const_iterator EdgesEnd() const { return OutEdges.end(); }
 
-    // Choose one of the outward edges based on command-line options.
-    const Edge* ChooseEdge() const;
-
     // Add an outward edge. Takes ownership of the Edge object.
     void AddEdge(Edge* E)
     { OutEdges.push_back(llvm::IntrusiveRefCntPtr<Edge>(E)); }
@@ -95,9 +92,13 @@
   class NodesIterator;
 
   class CompilationGraph {
-    typedef llvm::SmallVector<std::string, 3> tools_vector_type;
-    typedef llvm::StringMap<tools_vector_type> tools_map_type;
+    // Main data structure.
     typedef llvm::StringMap<Node> nodes_map_type;
+    // These are used to map from language names-> tools. (We can have
+    // several tools associated with each language name.)
+    typedef
+    llvm::SmallVector<llvm::IntrusiveRefCntPtr<Edge>, 3> tools_vector_type;
+    typedef llvm::StringMap<tools_vector_type> tools_map_type;
 
     // Map from file extensions to language names.
     LanguageMap ExtsToLangs;
@@ -154,6 +155,7 @@
 
     // Pass the input file through the toolchain.
     const JoinTool* PassThroughGraph (llvm::sys::Path& In,
+                                      const Node* StartNode,
                                       const llvm::sys::Path& TempDir) const;
 
   };