Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion llvm/include/llvm/ADT/StringSwitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define LLVM_ADT_STRINGSWITCH_H

#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include <cassert>
#include <cstring>
Expand All @@ -38,7 +39,7 @@ namespace llvm {
/// .Case("green", Green)
/// .Case("blue", Blue)
/// .Case("indigo", Indigo)
/// .Cases("violet", "purple", Violet)
/// .Cases({"violet", "purple"}, Violet)
/// .Default(UnknownColor);
/// \endcode
template<typename T, typename R = T>
Expand Down Expand Up @@ -107,31 +108,36 @@ class StringSwitch {
return CasesImpl(Value, {S0, S1, S2, S3, S4});
}

[[deprecated("Pass cases in std::initializer_list instead")]]
StringSwitch &Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2,
StringLiteral S3, StringLiteral S4, StringLiteral S5,
T Value) {
return CasesImpl(Value, {S0, S1, S2, S3, S4, S5});
}

[[deprecated("Pass cases in std::initializer_list instead")]]
StringSwitch &Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2,
StringLiteral S3, StringLiteral S4, StringLiteral S5,
StringLiteral S6, T Value) {
return CasesImpl(Value, {S0, S1, S2, S3, S4, S5, S6});
}

[[deprecated("Pass cases in std::initializer_list instead")]]
StringSwitch &Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2,
StringLiteral S3, StringLiteral S4, StringLiteral S5,
StringLiteral S6, StringLiteral S7, T Value) {
return CasesImpl(Value, {S0, S1, S2, S3, S4, S5, S6, S7});
}

[[deprecated("Pass cases in std::initializer_list instead")]]
StringSwitch &Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2,
StringLiteral S3, StringLiteral S4, StringLiteral S5,
StringLiteral S6, StringLiteral S7, StringLiteral S8,
T Value) {
return CasesImpl(Value, {S0, S1, S2, S3, S4, S5, S6, S7, S8});
}

[[deprecated("Pass cases in std::initializer_list instead")]]
StringSwitch &Cases(StringLiteral S0, StringLiteral S1, StringLiteral S2,
StringLiteral S3, StringLiteral S4, StringLiteral S5,
StringLiteral S6, StringLiteral S7, StringLiteral S8,
Expand Down
Loading