LLVM: include/llvm/Support/GlobPattern.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef LLVM_SUPPORT_GLOBPATTERN_H

14#define LLVM_SUPPORT_GLOBPATTERN_H

15

21#include

22

23namespace llvm {

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

53public:

54

55

56

57

59 create(StringRef Pat, std::optional<size_t> MaxSubPatterns = {});

60

62

63

64

66 if (PrefixSize)

67 return false;

68 if (SuffixSize)

69 return false;

70 if (SubGlobs.size() != 1)

71 return false;

72 return SubGlobs[0].getPat() == "*";

73 }

74

75

76

77

78

80

82

83

85

86private:

88 size_t PrefixSize = 0;

89 size_t SuffixSize = 0;

90

91 struct SubGlobPattern {

92

94

97

98

105 };

107};

108}

109

110#endif

This file implements the BitVector class.

#define LLVM_ABI_FOR_TEST

This file defines the SmallVector class.

Tagged union holding either a T or a Error.

This class implements a glob pattern matcher similar to the one found in bash, but with some key diff...

Definition GlobPattern.h:52

LLVM_ABI_FOR_TEST StringRef longest_substr() const

StringRef suffix() const

Definition GlobPattern.h:81

StringRef prefix() const

Definition GlobPattern.h:79

LLVM_ABI bool match(StringRef S) const

bool isTrivialMatchAll() const

Definition GlobPattern.h:65

static LLVM_ABI Expected< GlobPattern > create(StringRef Pat, std::optional< size_t > MaxSubPatterns={})

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

StringRef - Represent a constant reference to a string, i.e.

constexpr size_t size() const

size - Get the string size.

constexpr const char * data() const

data - Get a pointer to the start of the string (which may not be null terminated).

StringRef take_back(size_t N=1) const

Return a StringRef equal to 'this' but with only the last N elements remaining.

StringRef take_front(size_t N=1) const

Return a StringRef equal to 'this' but with only the first N elements remaining.

bool match(Val *V, const Pattern &P)

This is an optimization pass for GlobalISel generic memory operations.

Definition GlobPattern.h:99

BitVector Bytes

Definition GlobPattern.h:101

size_t NextOffset

Definition GlobPattern.h:100