This is an archive of the discontinued LLVM Phabricator instance.

Fix DecisionForestBenchmark.cpp compile errors
ClosedPublic

Authored by poelmanc on Feb 27 2021, 4:55 PM.

Details

Summary

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!

Diff Detail

Event Timeline

poelmanc created this revision.Feb 27 2021, 4:55 PM
poelmanc requested review of this revision.Feb 27 2021, 4:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2021, 4:55 PM
poelmanc updated this revision to Diff 326937.Feb 27 2021, 5:02 PM

Shorten comment and add period.

usaxena95 accepted this revision.Mar 1 2021, 2:42 AM

LG. Thanks for noticing and fixing it!

clang-tools-extra/clangd/benchmarks/CompletionModel/DecisionForestBenchmark.cpp
41–42

s/keys()/size().

This revision is now accepted and ready to land.Mar 1 2021, 2:42 AM
poelmanc updated this revision to Diff 327174.Mar 1 2021, 10:21 AM

Fix comment.

poelmanc marked an inline comment as done.Mar 1 2021, 10:22 AM

Fixed comment as requested (keys()->size().) I don't have commit access so if you can push it that would be great, thanks!

This revision was automatically updated to reflect the committed changes.