[lld][WebAssembly] Perform data relocations during start function
[llvm-project.git] / lldb / source / Utility / NameMatches.cpp
blob1c8cd6a0ca31dfd288cc6cbadd4d00daac64b984
1 //===-- NameMatches.cpp ---------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 #include "lldb/Utility/NameMatches.h"
9 #include "lldb/Utility/RegularExpression.h"
11 #include "llvm/ADT/StringRef.h"
13 using namespace lldb_private;
15 bool lldb_private::NameMatches(llvm::StringRef name, NameMatch match_type,
16 llvm::StringRef match) {
17 switch (match_type) {
18 case NameMatch::Ignore:
19 return true;
20 case NameMatch::Equals:
21 return name == match;
22 case NameMatch::Contains:
23 return name.contains(match);
24 case NameMatch::StartsWith:
25 return name.startswith(match);
26 case NameMatch::EndsWith:
27 return name.endswith(match);
28 case NameMatch::RegularExpression: {
29 RegularExpression regex(match);
30 return regex.Execute(name);
33 return false;