Add global versions of some Program static methods.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 12 Jun 2013 20:42:59 +0000 (20:42 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 12 Jun 2013 20:42:59 +0000 (20:42 +0000)
This is a temporary stepping stone for moving them out of Program.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183860 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Program.h

index 08a64dedfacadae72a574087425b829b33148a87..db12a153f63714eee7fe88432c77521f890e9df1 100644 (file)
@@ -17,6 +17,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/PathV1.h"
+#include "llvm/Support/system_error.h"
 
 namespace llvm {
 class error_code;
@@ -143,6 +144,24 @@ namespace sys {
 
   };
 
+  inline int ExecuteAndWait(const Path &path, const char **args,
+                            const char **env = 0,
+                            const sys::Path **redirects = 0,
+                            unsigned secondsToWait = 0,
+                            unsigned memoryLimit = 0, std::string *ErrMsg = 0,
+                            bool *ExecutionFailed = 0) {
+    return Program::ExecuteAndWait(path, args, env, redirects, secondsToWait,
+                                   memoryLimit, ErrMsg, ExecutionFailed);
+  }
+
+  inline Path FindProgramByName(const std::string& name) {
+    return Program::FindProgramByName(name);
+  }
+
+  inline error_code ChangeStdoutToBinary() {
+    return Program::ChangeStdoutToBinary();
+  }
+
   // Return true if the given arguments fit within system-specific
   // argument length limits.
   bool argumentsFitWithinSystemLimits(ArrayRef<const char*> Args);