[WebAssembly] Add a EM_WEBASSEMBLY value, and several bits of code that use it.
[oota-llvm.git] / include / llvm / Support / Program.h
index 734744a25e87f708d6d6eb37fef5ca17a7d83ba4..727864df2721e83d88ad3728bd32ffe561b0dcfe 100644 (file)
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/Support/ErrorOr.h"
-#include "llvm/Support/Path.h"
 #include <system_error>
 
 namespace llvm {
+class StringRef;
+
 namespace sys {
 
   /// This is the OS-specific separator for PATH like environment variables:
@@ -52,18 +53,6 @@ struct ProcessInfo {
   ProcessInfo();
 };
 
-  /// This function attempts to locate a program in the operating
-  /// system's file system using some pre-determined set of locations to search
-  /// (e.g. the PATH on Unix). Paths with slashes are returned unmodified.
-  ///
-  /// It does not perform hashing as a shell would but instead stats each PATH
-  /// entry individually so should generally be avoided. Core LLVM library
-  /// functions and options should instead require fully specified paths.
-  ///
-  /// @returns A string containing the path of the program or an empty string if
-  /// the program could not be found.
-  std::string FindProgramByName(const std::string& name);
-
   /// \brief Find the first executable file \p Name in \p Paths.
   ///
   /// This does not perform hashing as a shell would but instead stats each PATH
@@ -78,8 +67,7 @@ struct ProcessInfo {
   /// \returns The fully qualified path to the first \p Name in \p Paths if it
   ///   exists. \p Name if \p Name has slashes in it. Otherwise an error.
   ErrorOr<std::string>
-  findProgramByName(StringRef Name,
-                    ArrayRef<StringRef> Paths = ArrayRef<StringRef>());
+  findProgramByName(StringRef Name, ArrayRef<StringRef> Paths = None);
 
   // These functions change the specified standard stream (stdin or stdout) to
   // binary mode. They return errc::success if the specified stream
@@ -100,7 +88,7 @@ struct ProcessInfo {
   /// -2 indicates a crash during execution or timeout
   int ExecuteAndWait(
       StringRef Program, ///< Path of the program to be executed. It is
-      /// presumed this is the result of the FindProgramByName method.
+      /// presumed this is the result of the findProgramByName method.
       const char **args, ///< A vector of strings that are passed to the
       ///< program.  The first element should be the name of the program.
       ///< The list *must* be terminated by a null char* entry.
@@ -142,7 +130,7 @@ struct ProcessInfo {
 
   /// Return true if the given arguments fit within system-specific
   /// argument length limits.
-  bool argumentsFitWithinSystemLimits(ArrayRef<const char*> Args);
+  bool commandLineFitsWithinSystemLimits(StringRef Program, ArrayRef<const char*> Args);
 
   /// File encoding options when writing contents that a non-UTF8 tool will
   /// read (on Windows systems). For UNIX, we always use UTF-8.