diff --git a/clang/include/clang/Basic/CodeGenOptions.h b/clang/include/clang/Basic/CodeGenOptions.h --- a/clang/include/clang/Basic/CodeGenOptions.h +++ b/clang/include/clang/Basic/CodeGenOptions.h @@ -395,7 +395,7 @@ /// Executable and command-line used to create a given CompilerInvocation. /// Most of the time this will be the full -cc1 command. const char *Argv0 = nullptr; - ArrayRef CommandLineArgs; + std::vector CommandLineArgs; /// The minimum hotness value a diagnostic needs in order to be included in /// optimization diagnostics. diff --git a/clang/lib/Driver/Job.cpp b/clang/lib/Driver/Job.cpp --- a/clang/lib/Driver/Job.cpp +++ b/clang/lib/Driver/Job.cpp @@ -387,7 +387,6 @@ SmallVector Argv; Argv.push_back(getExecutable()); Argv.append(getArguments().begin(), getArguments().end()); - Argv.push_back(nullptr); // This flag simply indicates that the program couldn't start, which isn't // applicable here. diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -4520,7 +4520,7 @@ // Store the command-line for using in the CodeView backend. Res.getCodeGenOpts().Argv0 = Argv0; - Res.getCodeGenOpts().CommandLineArgs = CommandLineArgs; + append_range(Res.getCodeGenOpts().CommandLineArgs, CommandLineArgs); FixupInvocation(Res, Diags, Args, DashX); diff --git a/llvm/include/llvm/MC/MCTargetOptions.h b/llvm/include/llvm/MC/MCTargetOptions.h --- a/llvm/include/llvm/MC/MCTargetOptions.h +++ b/llvm/include/llvm/MC/MCTargetOptions.h @@ -64,7 +64,7 @@ std::string SplitDwarfFile; const char *Argv0 = nullptr; - ArrayRef CommandLineArgs; + ArrayRef CommandLineArgs; /// Additional paths to search for `.include` directives when using the /// integrated assembler.