Fix spelling and grammar in a comment.
[oota-llvm.git] / tools / llvmc2 / CompilationGraph.h
index 91a9c77f9a51bdbdf78de3b19202bec6a9c9e8d8..4324c38ab85465a924252617b6e47e8aa1eb8aa7 100644 (file)
@@ -22,6 +22,7 @@
 #include "llvm/ADT/iterator.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/StringSet.h"
 #include "llvm/System/Path.h"
 
 #include <cassert>
 
 namespace llvmc {
 
-  /// StringSet - A wrapper for StringMap that provides set-like
-  /// functionality.  Only insert() and count() methods are used by my
-  /// code.
-  template <class AllocatorTy = llvm::MallocAllocator>
-  class StringSet : public llvm::StringMap<char, AllocatorTy> {
-    typedef llvm::StringMap<char, AllocatorTy> base;
-  public:
-    void insert (const std::string& InLang) {
-      assert(!InLang.empty());
-      const char* KeyStart = &InLang[0];
-      const char* KeyEnd = KeyStart + InLang.size();
-      base::insert(llvm::StringMapEntry<char>::
-                   Create(KeyStart, KeyEnd, base::getAllocator(), '+'));
-    }
-  };
-  typedef StringSet<> InputLanguagesSet;
+  typedef llvm::StringSet<> InputLanguagesSet;
 
   /// Edge - Represents an edge of the compilation graph.
   class Edge : public llvm::RefCountedBaseVPTR<Edge> {
@@ -93,8 +79,6 @@ namespace llvmc {
     { OutEdges.push_back(llvm::IntrusiveRefCntPtr<Edge>(E)); }
 
     // Inward edge counter. Used to implement topological sort.
-    // TOTHINK: Move the mutable counter back into Tool classes? Makes
-    // us more const-correct.
     void IncrInEdges() { ++InEdges; }
     void DecrInEdges() { --InEdges; }
     bool HasNoInEdges() const { return InEdges == 0; }
@@ -125,8 +109,6 @@ namespace llvmc {
     llvm::SmallVector<llvm::IntrusiveRefCntPtr<Edge>, 3> tools_vector_type;
     typedef llvm::StringMap<tools_vector_type> tools_map_type;
 
-    /// ExtsToLangs - Map from file extensions to language names.
-    LanguageMap ExtsToLangs;
     /// ToolsMap - Map from language names to lists of tool names.
     tools_map_type ToolsMap;
     /// NodesMap - Map from tool names to Tool objects.
@@ -148,7 +130,7 @@ namespace llvmc {
     /// options are passed implicitly as global variables.
     int Build(llvm::sys::Path const& tempDir);
 
-    /// getNode -Return a reference to the node correponding to the
+    /// getNode - Return a reference to the node correponding to the
     /// given tool name. Throws std::runtime_error.
     Node& getNode(const std::string& ToolName);
     const Node& getNode(const std::string& ToolName) const;
@@ -166,15 +148,10 @@ namespace llvmc {
     // GraphTraits support.
     friend NodesIterator GraphBegin(CompilationGraph*);
     friend NodesIterator GraphEnd(CompilationGraph*);
-    friend void PopulateCompilationGraph(CompilationGraph&);
 
   private:
     // Helper functions.
 
-    /// getLanguage - Find out which language corresponds to the
-    /// suffix of this file.
-    const std::string& getLanguage(const llvm::sys::Path& File) const;
-
     /// getToolsVector - Return a reference to the list of tool names
     /// corresponding to the given language name. Throws
     /// std::runtime_error.