Skip to content

Commit c10a17b

Browse files
authored
Merge pull request #17494 from bob-wilson/pr16362-fix
[master-next] Fix up the driver's use of PROGRAM_START after PR #16362
2 parents 2a1a092 + ad9098f commit c10a17b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tools/driver/driver.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static int run_driver(StringRef ExecName,
180180
}
181181

182182
int main(int argc_, const char **argv_) {
183-
SmallVector<const char *, 256> argv(&argv_[0], &argv_[argc_]);
183+
SmallVector<const char *, 256> args(&argv_[0], &argv_[argc_]);
184184

185185
// Expand any response files in the command line argument vector - arguments
186186
// may be passed through response files in the event of command line length
@@ -192,11 +192,15 @@ int main(int argc_, const char **argv_) {
192192
llvm::Triple(llvm::sys::getProcessTriple()).isOSWindows() ?
193193
llvm::cl::TokenizeWindowsCommandLine :
194194
llvm::cl::TokenizeGNUCommandLine,
195-
argv);
195+
args);
196196

197197
// Initialize the stack trace using the parsed argument vector with expanded
198198
// response files.
199-
PROGRAM_START(argv.size(), argv.data());
199+
int ExpandedArgc = args.size();
200+
const char **ExpandedArgv = args.data();
201+
PROGRAM_START(ExpandedArgc, ExpandedArgv);
202+
SmallVector<const char *, 256> argv(&ExpandedArgv[0],
203+
&ExpandedArgv[ExpandedArgc]);
200204

201205
// Check if this invocation should execute a subcommand.
202206
StringRef ExecName = llvm::sys::path::stem(argv[0]);

0 commit comments

Comments
 (0)