add Case() with 5 args
authorNuno Lopes <nunoplopes@sapo.pt>
Tue, 17 Nov 2009 15:35:39 +0000 (15:35 +0000)
committerNuno Lopes <nunoplopes@sapo.pt>
Tue, 17 Nov 2009 15:35:39 +0000 (15:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89099 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/StringSwitch.h

index d9f69b215ac9f45d01195e9b21f5b3f9e8285b05..6562d57d3bb0ef64215d7068b6005e17d45075f4 100644 (file)
@@ -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)