Fix DecisionForestBenchmark.cpp compile errors
authorUtkarsh Saxena <usx@google.com>
Tue, 2 Mar 2021 09:09:22 +0000 (10:09 +0100)
committerUtkarsh Saxena <usx@google.com>
Tue, 2 Mar 2021 09:27:46 +0000 (10:27 +0100)
commitbad8e577f9c75c8b84efca79980781599e8e9f86
tree27f5ffc8a787d8a5049ff36455cd22ae830b8a14
parent438b5bb05a429d697674088d400e4800c1108658
Fix DecisionForestBenchmark.cpp compile errors

clang-tools-extra/clangd/benchmarks/CompletionModel/DecisionForestBenchmark.cpp fails to compile since `"CompletionModel.h"` is auto-generated from clang-tools-extra/clangd/quality/model/features.json, which was changed in https://reviews.llvm.org/D94697 to remove `setFilterLength` and `setIsForbidden`, rename `setFileProximityDistance` and `setSymbolScopeDistance`, and add `setNumNameInContext` and `setFractionNameInContext`.  This patch removes calls to the two removed functions, updates calls to the two renamed functions, and adds calls to the two new functions. (`20` is an arbitrary choice for the `setNumNameInContext` argument.) It also changes the `FlipCoin` argument from float to double to silence lossy conversion warnings.

Note: I don't use this tool but encountered the build errors and took a shot at fixing them. Please holler if there's another recommended solution. Thanks!

Reviewed By: usaxena95

Differential Revision: https://reviews.llvm.org/D97620
clang-tools-extra/clangd/benchmarks/CompletionModel/DecisionForestBenchmark.cpp