13 #ifndef LLVM_ADT_STRINGSWITCH_H 14 #define LLVM_ADT_STRINGSWITCH_H 42 template<
typename T,
typename R = T>
54 : Str(S), Result() { }
64 : Str(other.Str), Result(
std::move(other.Result)) { }
71 if (!Result && Str == S) {
72 Result = std::move(Value);
80 Result = std::move(Value);
88 Result = std::move(Value);
95 return Case(S0, Value).
Case(S1, Value);
101 return Case(S0, Value).
Cases(S1, S2, Value);
107 return Case(S0, Value).
Cases(S1, S2, S3, Value);
113 return Case(S0, Value).
Cases(S1, S2, S3, S4, Value);
120 return Case(S0, Value).
Cases(S1, S2, S3, S4, S5, Value);
127 return Case(S0, Value).
Cases(S1, S2, S3, S4, S5, S6, Value);
134 return Case(S0, Value).
Cases(S1, S2, S3, S4, S5, S6, S7, Value);
142 return Case(S0, Value).
Cases(S1, S2, S3, S4, S5, S6, S7, S8, Value);
150 return Case(S0, Value).
Cases(S1, S2, S3, S4, S5, S6, S7, S8, S9, Value);
157 Result = std::move(Value);
173 Result = std::move(Value);
205 return std::move(*Result);
212 assert(Result &&
"Fell off the end of a string-switch");
213 return std::move(*Result);
219 #endif // LLVM_ADT_STRINGSWITCH_H LLVM_NODISCARD bool startswith_lower(StringRef Prefix) const
Check if this string starts with the given Prefix, ignoring case.
This class represents lattice values for constants.
LLVM_NODISCARD bool equals_lower(StringRef RHS) const
equals_lower - Check for string equality, ignoring case.
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, StringLiteral S5, StringLiteral S6, StringLiteral S7, StringLiteral S8, T Value)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, StringLiteral S5, T Value)
LLVM_NODISCARD bool endswith_lower(StringRef Suffix) const
Check if this string ends with the given Suffix, ignoring case.
#define LLVM_NODISCARD
LLVM_NODISCARD - Warn if a type or return value is discarded.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool endswith(StringRef Suffix) const
Check if this string ends with the given Suffix.
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & CasesLower(StringLiteral S0, StringLiteral S1, T Value)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & StartsWithLower(StringLiteral S, T Value)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, T Value)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & CasesLower(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, T Value)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & CasesLower(StringLiteral S0, StringLiteral S1, StringLiteral S2, T Value)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE R Default(T Value)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & CasesLower(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, T Value)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, T Value)
#define LLVM_ATTRIBUTE_ALWAYS_INLINE
LLVM_ATTRIBUTE_ALWAYS_INLINE - On compilers where we have a directive to do so, mark a method "always...
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & EndsWithLower(StringLiteral S, T Value)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, StringLiteral S5, StringLiteral S6, T Value)
A switch()-like statement whose cases are string literals.
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, T Value)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & EndsWith(StringLiteral S, T Value)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & StartsWith(StringLiteral S, T Value)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Case(StringLiteral S, T Value)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch(StringRef S)
StringSwitch(StringSwitch &&other)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Cases(StringLiteral S0, StringLiteral S1, T Value)
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, StringLiteral S5, StringLiteral S6, StringLiteral S7, StringLiteral S8, StringLiteral S9, T Value)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & CaseLower(StringLiteral S, T Value)
LLVM Value Representation.
LLVM_ATTRIBUTE_ALWAYS_INLINE StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, StringLiteral S5, StringLiteral S6, StringLiteral S7, T Value)
void operator=(const StringSwitch &)=delete
StringRef - Represent a constant reference to a string, i.e.