diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Support/StringRef.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Support/StringRef.cpp | 7 |
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 //===----------------------------------------------------------------------===// |