aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Support/StringRef.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-07-04 19:20:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-02-08 19:02:26 +0000
commit81ad626541db97eb356e2c1d4a20eb2a26a766ab (patch)
tree311b6a8987c32b1e1dcbab65c54cfac3fdb56175 /contrib/llvm-project/llvm/lib/Support/StringRef.cpp
parent5fff09660e06a66bed6482da9c70df328e16bbb6 (diff)
parent145449b1e420787bb99721a429341fa6be3adfb6 (diff)
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Support/StringRef.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Support/StringRef.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/llvm-project/llvm/lib/Support/StringRef.cpp b/contrib/llvm-project/llvm/lib/Support/StringRef.cpp
index 3ed08ed38661..096b2d2d8c07 100644
--- a/contrib/llvm-project/llvm/lib/Support/StringRef.cpp
+++ b/contrib/llvm-project/llvm/lib/Support/StringRef.cpp
@@ -98,6 +98,13 @@ unsigned StringRef::edit_distance(llvm::StringRef Other,
AllowReplacements, MaxEditDistance);
}
+unsigned llvm::StringRef::edit_distance_insensitive(
+ StringRef Other, bool AllowReplacements, unsigned MaxEditDistance) const {
+ return llvm::ComputeMappedEditDistance(
+ makeArrayRef(data(), size()), makeArrayRef(Other.data(), Other.size()),
+ llvm::toLower, AllowReplacements, MaxEditDistance);
+}
+
//===----------------------------------------------------------------------===//
// String Operations
//===----------------------------------------------------------------------===//