Teach InlineFunction how to differentiate between multiple-value
[oota-llvm.git] / tools / llvmc2 / Tool.h
index 1cac7eed6978c62e6f9b35d9e96e4cee79bb682d..93fa5dfb43a9e3426f79cfb99bde1f9d81ad6df0 100644 (file)
@@ -1,4 +1,4 @@
-//===--- Tools.h - The LLVM Compiler Driver ---------------------*- C++ -*-===//
+//===--- Tool.h - The LLVM Compiler Driver ----------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -17,6 +17,7 @@
 #include "Action.h"
 
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
+#include "llvm/ADT/StringSet.h"
 #include "llvm/System/Path.h"
 
 #include <string>
 namespace llvmc {
 
   typedef std::vector<llvm::sys::Path> PathVector;
+  typedef llvm::StringSet<> InputLanguagesSet;
 
+  /// Tool - A class
   class Tool : public llvm::RefCountedBaseVPTR<Tool> {
   public:
 
     virtual ~Tool() {}
 
     virtual Action GenerateAction (const PathVector& inFiles,
-                                   const llvm::sys::Path& outFile) const = 0;
+                                   const llvm::sys::Path& outFile,
+                                   const InputLanguagesSet& InLangs) const = 0;
 
     virtual Action GenerateAction (const llvm::sys::Path& inFile,
-                                   const llvm::sys::Path& outFile) const = 0;
+                                   const llvm::sys::Path& outFile,
+                                   const InputLanguagesSet& InLangs) const = 0;
 
-    virtual const char* Name() const = 0;
-    virtual const char* InputLanguage() const = 0;
-    virtual const char* OutputLanguage() const = 0;
-    virtual const char* OutputSuffix() const = 0;
+    virtual const char*  Name() const = 0;
+    virtual const char** InputLanguages() const = 0;
+    virtual const char*  OutputLanguage() const = 0;
+    virtual const char*  OutputSuffix() const = 0;
 
     virtual bool IsLast() const = 0;
     virtual bool IsJoin() const = 0;
-
-    // Helper function that is called by the auto-generated code
-    // Splits strings of the form ",-foo,-bar,-baz"
-    // TOFIX: find a better name
-    static void UnpackValues (std::string const& from,
-                              std::vector<std::string>& to);
   };
 
-  // Join tools have an input file list associated with them.
+  /// JoinTool - A Tool that has an associated input file list.
   class JoinTool : public Tool {
   public:
     void AddToJoinList(const llvm::sys::Path& P) { JoinList_.push_back(P); }
     void ClearJoinList() { JoinList_.clear(); }
     bool JoinListEmpty() const { return JoinList_.empty(); }
 
-    Action GenerateAction(const llvm::sys::Path& outFile) const
-    { return GenerateAction(JoinList_, outFile); }
+    Action GenerateAction(const llvm::sys::Path& outFile,
+                          const InputLanguagesSet& InLangs) const {
+      return GenerateAction(JoinList_, outFile, InLangs);
+    }
     // We shouldn't shadow base class's version of GenerateAction.
     using Tool::GenerateAction;