LLVM: include/llvm/Demangle/StringViewExtras.h Source File (original) (raw)

Go to the documentation of this file.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15#ifndef DEMANGLE_STRINGVIEW_H

16#define DEMANGLE_STRINGVIEW_H

17

19

20#include <string_view>

21

23

24inline bool starts_with(std::string_view self, char C) noexcept {

25 return !self.empty() && *self.begin() == C;

26}

27

29 std::string_view needle) noexcept {

30 if (needle.size() > haystack.size())

31 return false;

32 haystack.remove_suffix(haystack.size() - needle.size());

33 return haystack == needle;

34}

35

37

38#endif

static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")

#define DEMANGLE_NAMESPACE_END

#define DEMANGLE_NAMESPACE_BEGIN