mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 23:23:38 -04:00
Rename sys::Process::GetArgumentVector -> sys::windows::GetCommandLineArguments
GetArgumentVector (or GetCommandLineArguments) is very Windows-specific. I think it doesn't make much sense to provide that function from sys::Process. I also made a change so that the function takes a BumpPtrAllocator instead of a SpecificBumpPtrAllocator. The latter is the class to call dtors, but since char * is trivially destructible, we should use the former class. Differential Revision: https://reviews.llvm.org/D45641 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330216 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -15,7 +15,12 @@
|
||||
#include "llvm/Support/Signals.h"
|
||||
#include <string>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "Windows/WindowsSupport.h"
|
||||
#endif
|
||||
|
||||
using namespace llvm;
|
||||
using namespace llvm::sys;
|
||||
|
||||
InitLLVM::InitLLVM(int &Argc, const char **&Argv) : StackPrinter(Argc, Argv) {
|
||||
sys::PrintStackTraceOnErrorSignal(Argv[0]);
|
||||
@@ -33,11 +38,10 @@ InitLLVM::InitLLVM(int &Argc, const char **&Argv) : StackPrinter(Argc, Argv) {
|
||||
std::string Banner = std::string(Argv[0]) + ": ";
|
||||
ExitOnError ExitOnErr(Banner);
|
||||
|
||||
ExitOnErr(errorCodeToError(
|
||||
sys::Process::GetArgumentVector(Args, makeArrayRef(Argv, Argc), Alloc)));
|
||||
ExitOnErr(errorCodeToError(windows::GetCommandLineArguments(Args, Alloc)));
|
||||
|
||||
// GetArgumentVector doesn't terminate the vector with a nullptr.
|
||||
// Do it to make it compatible with the real argv.
|
||||
// GetCommandLineArguments doesn't terminate the vector with a
|
||||
// nullptr. Do it to make it compatible with the real argv.
|
||||
Args.push_back(nullptr);
|
||||
|
||||
Argc = Args.size() - 1;
|
||||
|
||||
Reference in New Issue
Block a user