Go to the documentation of this file.
13 #ifndef LLVM_ADT_STRINGSWITCH_H
14 #define LLVM_ADT_STRINGSWITCH_H
43 template<
typename T,
typename R = T>
54 : Str(
S), Result() { }
64 : Str(other.Str), Result(
std::
move(other.Result)) { }
70 if (!Result && Str ==
S) {
77 if (!Result && Str.endswith(
S)) {
84 if (!Result && Str.startswith(
S)) {
138 return Case(S0,
Value).
Cases(S1, S2, S3, S4, S5, S6, S7, S8, S9,
Value);
143 if (!Result && Str.equals_insensitive(
S))
150 if (!Result && Str.endswith_insensitive(
S))
157 if (!Result && Str.startswith_insensitive(
S))
191 assert(Result &&
"Fell off the end of a string-switch");
198 #endif // LLVM_ADT_STRINGSWITCH_H
StringSwitch & Case(StringLiteral S, T Value)
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, StringLiteral S5, T Value)
StringSwitch & StartsWith(StringLiteral S, T Value)
This is an optimization pass for GlobalISel generic memory operations.
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, StringLiteral S5, StringLiteral S6, StringLiteral S7, StringLiteral S8, 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, T Value)
StringSwitch & EndsWith(StringLiteral S, T Value)
StringSwitch & CaseLower(StringLiteral S, T Value)
StringSwitch & StartsWithLower(StringLiteral S, T Value)
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
StringSwitch & EndsWithLower(StringLiteral S, 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(StringSwitch &&other)
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, T Value)
StringSwitch & CasesLower(StringLiteral S0, StringLiteral S1, T Value)
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, StringLiteral S5, StringLiteral S6, T Value)
StringSwitch & CasesLower(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, T Value)
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, StringLiteral S4, T Value)
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
void operator=(const StringSwitch &)=delete
StringSwitch(StringRef S)
StringRef - Represent a constant reference to a string, i.e.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, T Value)
#define LLVM_NODISCARD
LLVM_NODISCARD - Warn if a type or return value is discarded.
StringSwitch & CasesLower(StringLiteral S0, StringLiteral S1, StringLiteral S2, StringLiteral S3, T Value)
A switch()-like statement whose cases are string literals.
StringSwitch & CasesLower(StringLiteral S0, StringLiteral S1, StringLiteral S2, T Value)
StringSwitch & Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2, T Value)
LLVM Value Representation.