@@ -2530,24 +2530,24 @@ namespace {
2530
2530
void validateForeignReferenceType (const clang::CXXRecordDecl *decl,
2531
2531
ClassDecl *classDecl) {
2532
2532
2533
- enum class RetainReleaseOperatonKind {
2533
+ enum class RetainReleaseOperationKind {
2534
2534
notAfunction,
2535
2535
doesntReturnVoid,
2536
2536
invalidParameters,
2537
2537
valid
2538
2538
};
2539
2539
2540
2540
auto getOperationValidity =
2541
- [&](ValueDecl *operation) -> RetainReleaseOperatonKind {
2541
+ [&](ValueDecl *operation) -> RetainReleaseOperationKind {
2542
2542
auto operationFn = dyn_cast<FuncDecl>(operation);
2543
2543
if (!operationFn)
2544
- return RetainReleaseOperatonKind ::notAfunction;
2544
+ return RetainReleaseOperationKind ::notAfunction;
2545
2545
2546
2546
if (!operationFn->getResultInterfaceType ()->isVoid ())
2547
- return RetainReleaseOperatonKind ::doesntReturnVoid;
2547
+ return RetainReleaseOperationKind ::doesntReturnVoid;
2548
2548
2549
2549
if (operationFn->getParameters ()->size () != 1 )
2550
- return RetainReleaseOperatonKind ::invalidParameters;
2550
+ return RetainReleaseOperationKind ::invalidParameters;
2551
2551
2552
2552
Type paramType =
2553
2553
operationFn->getParameters ()->get (0 )->getInterfaceType ();
@@ -2564,13 +2564,13 @@ namespace {
2564
2564
if (const auto *paramTypeDecl =
2565
2565
dyn_cast<clang::CXXRecordDecl>(paramClangDecl)) {
2566
2566
if (decl->isDerivedFrom (paramTypeDecl)) {
2567
- return RetainReleaseOperatonKind ::valid;
2567
+ return RetainReleaseOperationKind ::valid;
2568
2568
}
2569
2569
}
2570
2570
}
2571
- return RetainReleaseOperatonKind ::invalidParameters;
2571
+ return RetainReleaseOperationKind ::invalidParameters;
2572
2572
}
2573
- return RetainReleaseOperatonKind ::valid;
2573
+ return RetainReleaseOperationKind ::valid;
2574
2574
};
2575
2575
2576
2576
auto retainOperation = evaluateOrDefault (
@@ -2607,28 +2607,28 @@ namespace {
2607
2607
false , retainOperation.name , decl->getNameAsString ());
2608
2608
} else if (retainOperation.kind ==
2609
2609
CustomRefCountingOperationResult::foundOperation) {
2610
- RetainReleaseOperatonKind operationKind =
2610
+ RetainReleaseOperationKind operationKind =
2611
2611
getOperationValidity (retainOperation.operation );
2612
2612
HeaderLoc loc (decl->getLocation ());
2613
2613
switch (operationKind) {
2614
- case RetainReleaseOperatonKind ::notAfunction:
2614
+ case RetainReleaseOperationKind ::notAfunction:
2615
2615
Impl.diagnose (
2616
2616
loc,
2617
2617
diag::foreign_reference_types_retain_release_not_a_function_decl,
2618
2618
false , retainOperation.name );
2619
2619
break ;
2620
- case RetainReleaseOperatonKind ::doesntReturnVoid:
2620
+ case RetainReleaseOperationKind ::doesntReturnVoid:
2621
2621
Impl.diagnose (
2622
2622
loc,
2623
2623
diag::foreign_reference_types_retain_release_non_void_return_type,
2624
2624
false , retainOperation.name );
2625
2625
break ;
2626
- case RetainReleaseOperatonKind ::invalidParameters:
2626
+ case RetainReleaseOperationKind ::invalidParameters:
2627
2627
Impl.diagnose (loc,
2628
2628
diag::foreign_reference_types_invalid_retain_release,
2629
2629
false , retainOperation.name , classDecl->getNameStr ());
2630
2630
break ;
2631
- case RetainReleaseOperatonKind ::valid:
2631
+ case RetainReleaseOperationKind ::valid:
2632
2632
break ;
2633
2633
}
2634
2634
} else {
@@ -2671,28 +2671,28 @@ namespace {
2671
2671
true , releaseOperation.name , decl->getNameAsString ());
2672
2672
} else if (releaseOperation.kind ==
2673
2673
CustomRefCountingOperationResult::foundOperation) {
2674
- RetainReleaseOperatonKind operationKind =
2674
+ RetainReleaseOperationKind operationKind =
2675
2675
getOperationValidity (releaseOperation.operation );
2676
2676
HeaderLoc loc (decl->getLocation ());
2677
2677
switch (operationKind) {
2678
- case RetainReleaseOperatonKind ::notAfunction:
2678
+ case RetainReleaseOperationKind ::notAfunction:
2679
2679
Impl.diagnose (
2680
2680
loc,
2681
2681
diag::foreign_reference_types_retain_release_not_a_function_decl,
2682
2682
true , releaseOperation.name );
2683
2683
break ;
2684
- case RetainReleaseOperatonKind ::doesntReturnVoid:
2684
+ case RetainReleaseOperationKind ::doesntReturnVoid:
2685
2685
Impl.diagnose (
2686
2686
loc,
2687
2687
diag::foreign_reference_types_retain_release_non_void_return_type,
2688
2688
true , releaseOperation.name );
2689
2689
break ;
2690
- case RetainReleaseOperatonKind ::invalidParameters:
2690
+ case RetainReleaseOperationKind ::invalidParameters:
2691
2691
Impl.diagnose (loc,
2692
2692
diag::foreign_reference_types_invalid_retain_release,
2693
2693
true , releaseOperation.name , classDecl->getNameStr ());
2694
2694
break ;
2695
- case RetainReleaseOperatonKind ::valid:
2695
+ case RetainReleaseOperationKind ::valid:
2696
2696
break ;
2697
2697
}
2698
2698
} else {
0 commit comments