[clang-tools-extra] r342227 - [clangd] NFC: Fix IndexBenchmark CLI arguments handling
Kirill Bobyrev via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 14 05:21:09 PDT 2018
Author: omtcyfz
Date: Fri Sep 14 05:21:09 2018
New Revision: 342227
URL: http://llvm.org/viewvc/llvm-project?rev=342227&view=rev
Log:
[clangd] NFC: Fix IndexBenchmark CLI arguments handling
Modified:
clang-tools-extra/trunk/clangd/benchmarks/IndexBenchmark.cpp
Modified: clang-tools-extra/trunk/clangd/benchmarks/IndexBenchmark.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/benchmarks/IndexBenchmark.cpp?rev=342227&r1=342226&r2=342227&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/benchmarks/IndexBenchmark.cpp (original)
+++ clang-tools-extra/trunk/clangd/benchmarks/IndexBenchmark.cpp Fri Sep 14 05:21:09 2018
@@ -101,9 +101,11 @@ int main(int argc, char *argv[]) {
}
IndexFilename = argv[1];
RequestsFilename = argv[2];
- // Trim first two arguments of the benchmark invocation.
- argv += 3;
- argc -= 3;
+ // Trim first two arguments of the benchmark invocation and pretend no
+ // arguments were passed in the first place.
+ argv[2] = argv[0];
+ argv += 2;
+ argc -= 2;
::benchmark::Initialize(&argc, argv);
::benchmark::RunSpecifiedBenchmarks();
}
More information about the cfe-commits
mailing list