================ @@ -839,9 +839,11 @@ int clang_scan_deps_main(int argc, char **argv, const llvm::ToolContext &) { auto R = std::make_reverse_iterator(FlagsEnd); for (auto I = R, E = Args.rend(); I != E; ++I) { StringRef Arg = *I; + if ((I + 1) == E) // Don't inspect Args[0] as an option. + break; ---------------- jansvoboda11 wrote:
Why not adjust `E` in the loop header instead of checking this on each iteration? https://github.com/llvm/llvm-project/pull/109050 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits