12 #ifndef LLVM_ADT_STRINGSWITCH_H 13 #define LLVM_ADT_STRINGSWITCH_H 41 template<
typename T,
typename R = T>
52 : Str(S), Result() { }
62 : Str(other.Str), Result(
std::move(other.Result)) { }
68 if (!Result && Str == S) {
69 Result = std::move(Value);
76 Result = std::move(Value);
83 Result = std::move(Value);
89 return Case(S0, Value).
Case(S1, Value);
94 return Case(S0, Value).
Cases(S1, S2, Value);
99 return Case(S0, Value).
Cases(S1, S2, S3, Value);
104 return Case(S0, Value).
Cases(S1, S2, S3, S4, Value);
110 return Case(S0, Value).
Cases(S1, S2, S3, S4, S5, Value);
116 return Case(S0, Value).
Cases(S1, S2, S3, S4, S5, S6, Value);
122 return Case(S0, Value).
Cases(S1, S2, S3, S4, S5, S6, S7, Value);
129 return Case(S0, Value).
Cases(S1, S2, S3, S4, S5, S6, S7, S8, Value);
136 return Case(S0, Value).
Cases(S1, S2, S3, S4, S5, S6, S7, S8, S9, Value);
142 Result = std::move(Value);
156 Result = std::move(Value);
183 return std::move(*Result);
189 assert(Result &&
"Fell off the end of a string-switch");
190 return std::move(*Result);
196 #endif // LLVM_ADT_STRINGSWITCH_H LLVM_NODISCARD bool startswith_lower(StringRef Prefix) const
Check if this string starts with the given Prefix, ignoring case.
LLVM_NODISCARD bool endswith(StringRef Suffix) const
Check if this string ends with the given Suffix.
This class represents lattice values for constants.
LLVM_NODISCARD bool equals_lower(StringRef RHS) const
equals_lower - Check for string equality, ignoring case.
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
StringSwitch & StartsWith(StringLiteral S, T Value)
LLVM_NODISCARD bool endswith_lower(StringRef Suffix) const
Check if this string ends with the given Suffix, ignoring case.
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, T Value)
StringSwitch & Case(StringLiteral S, T Value)
LLVM_NODISCARD R Default(T Value)
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, StringLiteral S5, StringLiteral S6, StringLiteral S7, StringLiteral S8, T Value)
StringSwitch & CasesLower(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, T Value)
StringSwitch & CaseLower(StringLiteral S, T Value)
StringSwitch & EndsWithLower(StringLiteral S, 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...
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, T Value)
StringSwitch & EndsWith(StringLiteral S, T Value)
StringSwitch & StartsWithLower(StringLiteral S, T Value)
StringSwitch(StringRef S)
StringSwitch & CasesLower(StringLiteral S0, StringLiteral S1, T Value)
StringSwitch & CasesLower(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, T Value)
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, StringLiteral S5, StringLiteral S6, StringLiteral S7, StringLiteral S8, StringLiteral S9, T Value)
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, StringLiteral S5, StringLiteral S6, T Value)
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, T Value)
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, T Value)
StringSwitch(StringSwitch &&other)
StringSwitch & CasesLower(StringLiteral S0, StringLiteral S1, StringLiteral S2, T Value)
#define LLVM_NODISCARD
LLVM_NODISCARD - Warn if a type or return value is discarded.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, StringLiteral S5, StringLiteral S6, StringLiteral S7, T Value)
LLVM Value Representation.
void operator=(const StringSwitch &)=delete
StringRef - Represent a constant reference to a string, i.e.
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, StringLiteral S5, T Value)