AST,Basic: update support for process execution on Windows

Implement process launching on Windows to support macros.  Prefer to use
the LLVM types wherever possible.  The pipes are converted into file
descriptors as the types are internal to the process.  This allows us to
have similar paths on both sides and avoid having to drag in `Windows.h`
for the definition of `HANDLE`.  This is the core missing functionality
for Windows to support macros.
This commit is contained in:
Saleem Abdulrasool
2023-09-01 14:27:54 -07:00
parent ffc9fb3a60
commit 06ad3a75b6
5 changed files with 157 additions and 28 deletions

View File

@@ -40,14 +40,12 @@ int ExecuteInPlace(const char *Program, const char **args,
const char **env = nullptr);
struct ChildProcessInfo {
llvm::sys::procid_t Pid;
int WriteFileDescriptor;
int ReadFileDescriptor;
llvm::sys::ProcessInfo ProcessInfo;
int Write;
int Read;
ChildProcessInfo(llvm::sys::procid_t Pid, int WriteFileDescriptor,
int ReadFileDescriptor)
: Pid(Pid), WriteFileDescriptor(WriteFileDescriptor),
ReadFileDescriptor(ReadFileDescriptor) {}
ChildProcessInfo(llvm::sys::ProcessInfo ProcessInfo, int Write, int Read)
: ProcessInfo(ProcessInfo), Write(Write), Read(Read) {}
};
/// This function executes the program using the argument provided.