Add some comments explaining what MVT and EVT are, and how they differ.
[oota-llvm.git] / include / llvm / System / Program.h
index 7f96245130f51fde901c79c0583283db17326ad6..0c14076e309c1c7f3614a2e4eee1a3cd311a8fc4 100644 (file)
@@ -30,9 +30,7 @@ namespace sys {
   /// @brief An abstraction for finding and executing programs.
   class Program {
     /// Opaque handle for target specific data.
-       void *Data;
-
-    unsigned Pid_;
+    void *Data_;
 
     // Noncopyable.
     Program(const Program& other);
@@ -43,10 +41,10 @@ namespace sys {
   public:
 
     Program();
-       ~Program();
-       
+    ~Program();
+
     /// Return process ID of this program.
-    unsigned GetPid() { return Pid_; }
+    unsigned GetPid() const;
 
     /// This function executes the program using the \p arguments provided.  The
     /// invoked program will inherit the stdin, stdout, and stderr file
@@ -92,14 +90,25 @@ namespace sys {
     /// @see Execute
     /// @brief Waits for the program to exit.
     int Wait
-    ( unsigned secondsToWait = 0, ///< If non-zero, this specifies the amount
+    ( const Path& path, ///< The path to the child process executable.
+      unsigned secondsToWait, ///< If non-zero, this specifies the amount
       ///< of time to wait for the child process to exit. If the time
       ///< expires, the child is killed and this call returns. If zero,
       ///< this function will wait until the child finishes or forever if
       ///< it doesn't.
-      std::string* ErrMsg = 0 ///< If non-zero, provides a pointer to a string
+      std::string* ErrMsg ///< If non-zero, provides a pointer to a string
       ///< instance in which error messages will be returned. If the string
-      ///< is non-empty upon return an error occurred while invoking the
+      ///< is non-empty upon return an error occurred while waiting.
+      );
+
+    /// This function terminates the program.
+    /// @returns true if an error occured.
+    /// @see Execute
+    /// @brief Terminates the program.
+    bool Kill
+    ( std::string* ErrMsg = 0 ///< If non-zero, provides a pointer to a string
+      ///< instance in which error messages will be returned. If the string
+      ///< is non-empty upon return an error occurred while killing the
       ///< program.
       );
 
@@ -108,18 +117,18 @@ namespace sys {
     /// locations to search (e.g. the PATH on Unix).
     /// @returns A Path object initialized to the path of the program or a
     /// Path object that is empty (invalid) if the program could not be found.
-    /// @throws nothing
     /// @brief Construct a Program by finding it by name.
     static Path FindProgramByName(const std::string& name);
 
-    // These methods change the specified standard stream (stdin or stdout) to
-    // binary mode. They return true if an error occurred
+    // These methods change the specified standard stream (stdin,
+    // stdout, or stderr) to binary mode. They return true if an error
+    // occurred
     static bool ChangeStdinToBinary();
     static bool ChangeStdoutToBinary();
+    static bool ChangeStderrToBinary();
 
     /// A convenience function equivalent to Program prg; prg.Execute(..);
     /// prg.Wait(..);
-    /// @throws nothing
     /// @see Execute, Wait
     static int ExecuteAndWait(const Path& path,
                               const char** args,
@@ -130,7 +139,6 @@ namespace sys {
                               std::string* ErrMsg = 0);
 
     /// A convenience function equivalent to Program prg; prg.Execute(..);
-    /// @throws nothing
     /// @see Execute
     static void ExecuteNoWait(const Path& path,
                               const char** args,