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