Skip to content

Commit a9a510f

Browse files
committed
[bugpoint] Fix repeated off-by-one error in debug output
This resulted in the final argument being dropped from the output, which can be rather important.
1 parent 43bb5f0 commit a9a510f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

llvm/tools/bugpoint/ToolRunner.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Expected<int> LLI::ExecuteProgram(const std::string &Bitcode,
192192
outs() << "<lli>";
193193
outs().flush();
194194
LLVM_DEBUG(errs() << "\nAbout to run:\t";
195-
for (unsigned i = 0, e = LLIArgs.size() - 1; i != e; ++i) errs()
195+
for (unsigned i = 0, e = LLIArgs.size(); i != e; ++i) errs()
196196
<< " " << LLIArgs[i];
197197
errs() << "\n";);
198198
return RunProgramWithTimeout(LLIPath, LLIArgs, InputFile, OutputFile,
@@ -460,7 +460,7 @@ Expected<CC::FileType> LLC::OutputCode(const std::string &Bitcode,
460460
outs() << (UseIntegratedAssembler ? "<llc-ia>" : "<llc>");
461461
outs().flush();
462462
LLVM_DEBUG(errs() << "\nAbout to run:\t";
463-
for (unsigned i = 0, e = LLCArgs.size() - 1; i != e; ++i) errs()
463+
for (unsigned i = 0, e = LLCArgs.size(); i != e; ++i) errs()
464464
<< " " << LLCArgs[i];
465465
errs() << "\n";);
466466
if (RunProgramWithTimeout(LLCPath, LLCArgs, "", "", "", Timeout, MemoryLimit))
@@ -578,7 +578,7 @@ Expected<int> JIT::ExecuteProgram(const std::string &Bitcode,
578578
outs() << "<jit>";
579579
outs().flush();
580580
LLVM_DEBUG(errs() << "\nAbout to run:\t";
581-
for (unsigned i = 0, e = JITArgs.size() - 1; i != e; ++i) errs()
581+
for (unsigned i = 0, e = JITArgs.size(); i != e; ++i) errs()
582582
<< " " << JITArgs[i];
583583
errs() << "\n";);
584584
LLVM_DEBUG(errs() << "\nSending output to " << OutputFile << "\n");
@@ -685,7 +685,7 @@ Expected<int> CC::ExecuteProgram(const std::string &ProgramFile,
685685
outs() << "<CC>";
686686
outs().flush();
687687
LLVM_DEBUG(errs() << "\nAbout to run:\t";
688-
for (unsigned i = 0, e = CCArgs.size() - 1; i != e; ++i) errs()
688+
for (unsigned i = 0, e = CCArgs.size(); i != e; ++i) errs()
689689
<< " " << CCArgs[i];
690690
errs() << "\n";);
691691
if (RunProgramWithTimeout(CCPath, CCArgs, "", "", ""))
@@ -733,7 +733,7 @@ Expected<int> CC::ExecuteProgram(const std::string &ProgramFile,
733733
outs().flush();
734734
LLVM_DEBUG(
735735
errs() << "\nAbout to run:\t";
736-
for (unsigned i = 0, e = ProgramArgs.size() - 1; i != e; ++i) errs()
736+
for (unsigned i = 0, e = ProgramArgs.size(); i != e; ++i) errs()
737737
<< " " << ProgramArgs[i];
738738
errs() << "\n";);
739739

@@ -829,7 +829,7 @@ Error CC::MakeSharedObject(const std::string &InputFile, FileType fileType,
829829
outs() << "<CC>";
830830
outs().flush();
831831
LLVM_DEBUG(errs() << "\nAbout to run:\t";
832-
for (unsigned i = 0, e = CCArgs.size() - 1; i != e; ++i) errs()
832+
for (unsigned i = 0, e = CCArgs.size(); i != e; ++i) errs()
833833
<< " " << CCArgs[i];
834834
errs() << "\n";);
835835
if (RunProgramWithTimeout(CCPath, CCArgs, "", "", ""))

0 commit comments

Comments
 (0)