Move and copy function calls around to remove the indirection through gotos
from the switch statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121626 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index abe1a33..5ec7b93 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -5543,7 +5543,7 @@
     if (NumArgs == 1)
       OpBuilder.addUnaryStarPointerOverloads();
     else
-      goto BinaryStar;
+      OpBuilder.addGenericBinaryArithmeticOverloads(/*isComparison=*/false);
     break;
 
   case OO_Plus: // '+' is either unary or binary
@@ -5551,15 +5551,18 @@
       OpBuilder.addUnaryPlusPointerOverloads();
       OpBuilder.addUnaryPlusOrMinusArithmeticOverloads();
     } else {
-      goto BinaryPlus;
+      OpBuilder.addBinaryPlusOrMinusPointerOverloads(Op);
+      OpBuilder.addGenericBinaryArithmeticOverloads(/*isComparison=*/false);
     }
     break;
 
   case OO_Minus: // '-' is either unary or binary
-    if (NumArgs == 1)
+    if (NumArgs == 1) {
       OpBuilder.addUnaryPlusOrMinusArithmeticOverloads();
-    else
-      goto BinaryMinus;
+    } else {
+      OpBuilder.addBinaryPlusOrMinusPointerOverloads(Op);
+      OpBuilder.addGenericBinaryArithmeticOverloads(/*isComparison=*/false);
+    }
     break;
 
   case OO_Amp: // '&' is either unary or binary
@@ -5609,15 +5612,7 @@
     OpBuilder.addGenericBinaryArithmeticOverloads(/*isComparison=*/true);
     break;
 
-  BinaryPlus:
-  BinaryMinus:
-    OpBuilder.addBinaryPlusOrMinusPointerOverloads(Op);
-    OpBuilder.addGenericBinaryArithmeticOverloads(/*isComparison=*/false);;
-    break;
-
   case OO_Slash:
-  BinaryStar:
-  Conditional:
     OpBuilder.addGenericBinaryArithmeticOverloads(/*isComparison=*/false);
     break;
 
@@ -5672,7 +5667,8 @@
 
   case OO_Conditional:
     OpBuilder.addConditionalOperatorOverloads();
-    goto Conditional;
+    OpBuilder.addGenericBinaryArithmeticOverloads(/*isComparison=*/false);
+    break;
   }
 }