File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
clang/lib/Tooling/DependencyScanning Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -730,15 +730,13 @@ bool CompilerInstanceWithContext::initialize(DiagnosticConsumer *DC) {
730730 " Must have a job list of non-zero size" );
731731 const driver::Command &Command = *(Compilation->getJobs ().begin ());
732732 const auto &CommandArgs = Command.getArguments ();
733- size_t ArgSize = CommandArgs.size ();
734- assert (ArgSize >= 1 && " Cannot have a command with 0 args" );
735- const char *FirstArg = CommandArgs[0 ];
736- assert (StringRef (FirstArg) == " -cc1" && " Requires a cc1 job." );
733+ assert (!CommandArgs.empty () && " Cannot have a command with 0 args" );
734+ assert (StringRef (CommandArgs[0 ]) == " -cc1" && " Requires a cc1 job." );
737735 OriginalInvocation = std::make_unique<CompilerInvocation>();
738736
739- if (!CompilerInvocation::CreateFromArgs (
740- *OriginalInvocation, Command. getArguments () ,
741- *DiagEngineWithCmdAndOpts-> DiagEngine , Command.getExecutable ())) {
737+ if (!CompilerInvocation::CreateFromArgs (*OriginalInvocation, CommandArgs,
738+ *DiagEngineWithCmdAndOpts-> DiagEngine ,
739+ Command.getExecutable ())) {
742740 DiagEngineWithCmdAndOpts->DiagEngine ->Report (
743741 diag::err_fe_expected_compiler_job)
744742 << llvm::join (CommandLine, " " );
You can’t perform that action at this time.
0 commit comments