[PATCH] D51971: [clangd] Use JSON format in benchmark requests reader
Ilya Biryukov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 13 00:08:14 PDT 2018
ilya-biryukov added inline comments.
================
Comment at: clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp:45
+ if (!JSONArray) {
+ llvm::errs() << "Couldn't parse request.\n";
+ }
----------------
Return from function after error?
================
Comment at: clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp:47
+ }
+ FuzzyFindRequest Request;
+ for (const auto &Item : *JSONArray->getAsArray()) {
----------------
Maybe declare this var inside the loop where it's used?
================
Comment at: clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp:48
+ FuzzyFindRequest Request;
+ for (const auto &Item : *JSONArray->getAsArray()) {
+ fromJSON(Item, Request);
----------------
Check that the parsed value is an array and report an error if not?
https://reviews.llvm.org/D51971
More information about the cfe-commits
mailing list