mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
[Support] Expose flattenWindowsCommandLine.
This function was internal to Program.inc, but I've needed this on several occasions when I've had to use CreateProcess without llvm's sys::Execute functions. In doing so, I noticed that the function was written using unsafe C-string access and was pretty hard to understand / make sense of, so I've also re-written the functions to use more modern LLVM constructs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334353 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -63,6 +63,15 @@ ProcessInfo sys::ExecuteNoWait(StringRef Program, const char **Args,
|
||||
return PI;
|
||||
}
|
||||
|
||||
bool sys::commandLineFitsWithinSystemLimits(StringRef Program,
|
||||
ArrayRef<const char *> Args) {
|
||||
SmallVector<StringRef, 8> StringRefArgs;
|
||||
StringRefArgs.reserve(Args.size());
|
||||
for (const char *A : Args)
|
||||
StringRefArgs.emplace_back(A);
|
||||
return commandLineFitsWithinSystemLimits(Program, StringRefArgs);
|
||||
}
|
||||
|
||||
// Include the platform-specific parts of this class.
|
||||
#ifdef LLVM_ON_UNIX
|
||||
#include "Unix/Program.inc"
|
||||
|
||||
Reference in New Issue
Block a user