aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2009-11-17 15:35:39 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2009-11-17 15:35:39 +0000
commit2cd8abbf8631921c744d021214dd21998a25a946 (patch)
tree639f4a849e8ec5714ac3efb4318a212e067d4439
parent789b45b066d3e0cbaec71aa1b8defd8fe7a55a36 (diff)
add Case() with 5 args
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89099 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/ADT/StringSwitch.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/ADT/StringSwitch.h b/include/llvm/ADT/StringSwitch.h
index d9f69b215a..6562d57d3b 100644
--- a/include/llvm/ADT/StringSwitch.h
+++ b/include/llvm/ADT/StringSwitch.h
@@ -83,6 +83,14 @@ public:
const T& Value) {
return Case(S0, Value).Case(S1, Value).Case(S2, Value).Case(S3, Value);
}
+
+ template<unsigned N0, unsigned N1, unsigned N2, unsigned N3, unsigned N4>
+ StringSwitch& Cases(const char (&S0)[N0], const char (&S1)[N1],
+ const char (&S2)[N2], const char (&S3)[N3],
+ const char (&S4)[N4], const T& Value) {
+ return Case(S0, Value).Case(S1, Value).Case(S2, Value).Case(S3, Value)
+ .Case(S4, Value);
+ }
T Default(const T& Value) {
if (ResultKnown)