Get rid of exceptions in llvmc.
[oota-llvm.git] / include / llvm / CompilerDriver / Tool.h
index 85d1690bcfedecb41073b2f3d457fea949811f08..d064a03eebce7751f64ef55d7aaad67d52b45312 100644 (file)
@@ -38,17 +38,19 @@ namespace llvmc {
 
     virtual ~Tool() {}
 
-    virtual Action GenerateAction (const PathVector& inFiles,
-                                   bool  HasChildren,
-                                   const llvm::sys::Path& TempDir,
-                                   const InputLanguagesSet& InLangs,
-                                   const LanguageMap& LangMap) const = 0;
-
-    virtual Action GenerateAction (const llvm::sys::Path& inFile,
-                                   bool  HasChildren,
-                                   const llvm::sys::Path& TempDir,
-                                   const InputLanguagesSet& InLangs,
-                                   const LanguageMap& LangMap) const = 0;
+    virtual int GenerateAction (Action& Out,
+                                const PathVector& inFiles,
+                                const bool HasChildren,
+                                const llvm::sys::Path& TempDir,
+                                const InputLanguagesSet& InLangs,
+                                const LanguageMap& LangMap) const = 0;
+
+    virtual int GenerateAction (Action& Out,
+                                const llvm::sys::Path& inFile,
+                                const bool HasChildren,
+                                const llvm::sys::Path& TempDir,
+                                const InputLanguagesSet& InLangs,
+                                const LanguageMap& LangMap) const = 0;
 
     virtual const char*  Name() const = 0;
     virtual const char** InputLanguages() const = 0;
@@ -74,11 +76,13 @@ namespace llvmc {
     void ClearJoinList() { JoinList_.clear(); }
     bool JoinListEmpty() const { return JoinList_.empty(); }
 
-    Action GenerateAction(bool  HasChildren,
-                          const llvm::sys::Path& TempDir,
-                          const InputLanguagesSet& InLangs,
-                          const LanguageMap& LangMap) const {
-      return GenerateAction(JoinList_, HasChildren, TempDir, InLangs, LangMap);
+    int GenerateAction(Action& Out,
+                       const bool HasChildren,
+                       const llvm::sys::Path& TempDir,
+                       const InputLanguagesSet& InLangs,
+                       const LanguageMap& LangMap) const {
+      return GenerateAction(Out, JoinList_, HasChildren, TempDir, InLangs,
+                            LangMap);
     }
     // We shouldn't shadow base class's version of GenerateAction.
     using Tool::GenerateAction;