diff options
| author | 2023-07-18 21:39:37 -0400 | |
|---|---|---|
| committer | 2023-07-18 22:39:26 -0400 | |
| commit | 1ab3bd5a5eb966ce3966688857c6fa516039c1c2 (patch) | |
| tree | 0666011e6ddd40c71534c1827f86f7b297170edf /externals/demangle/llvm/Demangle/StringViewExtras.h | |
| parent | CMake: Require LLVM 17 or later (diff) | |
| download | yuzu-1ab3bd5a5eb966ce3966688857c6fa516039c1c2.tar.gz yuzu-1ab3bd5a5eb966ce3966688857c6fa516039c1c2.tar.xz yuzu-1ab3bd5a5eb966ce3966688857c6fa516039c1c2.zip | |
demangle: Update to llvm/llvm-project@ecbc812e0cca
Diffstat (limited to '')
| -rw-r--r-- | externals/demangle/llvm/Demangle/StringViewExtras.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/externals/demangle/llvm/Demangle/StringViewExtras.h b/externals/demangle/llvm/Demangle/StringViewExtras.h new file mode 100644 index 000000000..83685c304 --- /dev/null +++ b/externals/demangle/llvm/Demangle/StringViewExtras.h | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | //===--- StringViewExtras.h ----------*- mode:c++;eval:(read-only-mode) -*-===// | ||
| 2 | // Do not edit! See README.txt. | ||
| 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-FileCopyrightText: Part of the LLVM Project | ||
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| 7 | // | ||
| 8 | //===----------------------------------------------------------------------===// | ||
| 9 | // | ||
| 10 | // There are two copies of this file in the source tree. The one under | ||
| 11 | // libcxxabi is the original and the one under llvm is the copy. Use | ||
| 12 | // cp-to-llvm.sh to update the copy. See README.txt for more details. | ||
| 13 | // | ||
| 14 | //===----------------------------------------------------------------------===// | ||
| 15 | |||
| 16 | #ifndef DEMANGLE_STRINGVIEW_H | ||
| 17 | #define DEMANGLE_STRINGVIEW_H | ||
| 18 | |||
| 19 | #include "DemangleConfig.h" | ||
| 20 | |||
| 21 | #include <string_view> | ||
| 22 | |||
| 23 | DEMANGLE_NAMESPACE_BEGIN | ||
| 24 | |||
| 25 | inline bool starts_with(std::string_view self, char C) noexcept { | ||
| 26 | return !self.empty() && *self.begin() == C; | ||
| 27 | } | ||
| 28 | |||
| 29 | inline bool starts_with(std::string_view haystack, | ||
| 30 | std::string_view needle) noexcept { | ||
| 31 | if (needle.size() > haystack.size()) | ||
| 32 | return false; | ||
| 33 | haystack.remove_suffix(haystack.size() - needle.size()); | ||
| 34 | return haystack == needle; | ||
| 35 | } | ||
| 36 | |||
| 37 | DEMANGLE_NAMESPACE_END | ||
| 38 | |||
| 39 | #endif | ||