diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2010-12-12 08:32:28 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2010-12-12 08:32:28 +0000 |
| commit | 0375e954468f128f52ad6cf198e0d06095e7927a (patch) | |
| tree | 57a3b08bcde469cc7f6aea39b364f03611ebced1 /clang | |
| parent | 8e543b3d46932f95178dde1d2ba4af01bc6f45c1 (diff) | |
| download | bcm5719-llvm-0375e954468f128f52ad6cf198e0d06095e7927a.tar.gz bcm5719-llvm-0375e954468f128f52ad6cf198e0d06095e7927a.zip | |
Simplify the flow through the switch by explicitly listing the added overloads
for a few cases.
llvm-svn: 121625
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 278f232c2c0..abe1a33fd29 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -5533,7 +5533,6 @@ Sema::AddBuiltinOperatorCandidates(OverloadedOperatorKind Op, CandidateTypes, CandidateSet); // Dispatch over the operation to add in only those overloads which apply. - bool isComparison = false; switch (Op) { case OO_None: case NUM_OVERLOADED_OPERATORS: @@ -5600,31 +5599,26 @@ Sema::AddBuiltinOperatorCandidates(OverloadedOperatorKind Op, case OO_EqualEqual: case OO_ExclaimEqual: OpBuilder.addEqualEqualOrNotEqualMemberPointerOverloads(); - - // Fall through - + // Fall through. case OO_Less: case OO_Greater: case OO_LessEqual: case OO_GreaterEqual: OpBuilder.addRelationalPointerOrEnumeralOverloads( UserDefinedBinaryOperators); - - // Fall through. - isComparison = true; + OpBuilder.addGenericBinaryArithmeticOverloads(/*isComparison=*/true); + break; BinaryPlus: BinaryMinus: - if (!isComparison) { - // We didn't fall through, so we must have OO_Plus or OO_Minus. - OpBuilder.addBinaryPlusOrMinusPointerOverloads(Op); - } - // Fall through + OpBuilder.addBinaryPlusOrMinusPointerOverloads(Op); + OpBuilder.addGenericBinaryArithmeticOverloads(/*isComparison=*/false);; + break; case OO_Slash: BinaryStar: Conditional: - OpBuilder.addGenericBinaryArithmeticOverloads(isComparison); + OpBuilder.addGenericBinaryArithmeticOverloads(/*isComparison=*/false); break; case OO_Percent: |

