aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/CommandLineTest.cpp
diff options
context:
space:
mode:
authorBrian Gesiak <modocache@gmail.com>2018-05-14 21:35:00 +0000
committerBrian Gesiak <modocache@gmail.com>2018-05-14 21:35:00 +0000
commiteda977f414fead94b5072dd35d53be2fa71c5f00 (patch)
tree52d42f9f76d47dca4dbcb13cbaf4c5e0e863a112 /llvm/unittests/Support/CommandLineTest.cpp
parentace7ae935ffc181b79d5a22d58589949191b3416 (diff)
downloadllvm-eda977f414fead94b5072dd35d53be2fa71c5f00.zip
llvm-eda977f414fead94b5072dd35d53be2fa71c5f00.tar.gz
llvm-eda977f414fead94b5072dd35d53be2fa71c5f00.tar.bz2
[Option] Fix PR37006 prefix choice in findNearest
Summary: In https://bugs.llvm.org/show_bug.cgi?id=37006 Nico Weber points out a flaw in `OptTable::findNearest`: if an option "foo"'s prefixes are "--" and "-", then the nearest option for "--fob" will be "-foo". This is incorrect, however, since the function is expected to return "--foo". The bug is due to a naive loop that attempts to predetermines which prefix is best. Instead, compute the edit distance for each prefix/name pair. Test Plan: `check-llvm` Reviewers: thakis Reviewed By: thakis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46776 llvm-svn: 332299
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
0 files changed, 0 insertions, 0 deletions