Skip to content

Commit 51fd394

Browse files
committed
[cxx-interop] fix typo in RetainReleaseOperationKind enum
1 parent 8a0a083 commit 51fd394

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2530,24 +2530,24 @@ namespace {
25302530
void validateForeignReferenceType(const clang::CXXRecordDecl *decl,
25312531
ClassDecl *classDecl) {
25322532

2533-
enum class RetainReleaseOperatonKind {
2533+
enum class RetainReleaseOperationKind {
25342534
notAfunction,
25352535
doesntReturnVoid,
25362536
invalidParameters,
25372537
valid
25382538
};
25392539

25402540
auto getOperationValidity =
2541-
[&](ValueDecl *operation) -> RetainReleaseOperatonKind {
2541+
[&](ValueDecl *operation) -> RetainReleaseOperationKind {
25422542
auto operationFn = dyn_cast<FuncDecl>(operation);
25432543
if (!operationFn)
2544-
return RetainReleaseOperatonKind::notAfunction;
2544+
return RetainReleaseOperationKind::notAfunction;
25452545

25462546
if (!operationFn->getResultInterfaceType()->isVoid())
2547-
return RetainReleaseOperatonKind::doesntReturnVoid;
2547+
return RetainReleaseOperationKind::doesntReturnVoid;
25482548

25492549
if (operationFn->getParameters()->size() != 1)
2550-
return RetainReleaseOperatonKind::invalidParameters;
2550+
return RetainReleaseOperationKind::invalidParameters;
25512551

25522552
Type paramType =
25532553
operationFn->getParameters()->get(0)->getInterfaceType();
@@ -2564,13 +2564,13 @@ namespace {
25642564
if (const auto *paramTypeDecl =
25652565
dyn_cast<clang::CXXRecordDecl>(paramClangDecl)) {
25662566
if (decl->isDerivedFrom(paramTypeDecl)) {
2567-
return RetainReleaseOperatonKind::valid;
2567+
return RetainReleaseOperationKind::valid;
25682568
}
25692569
}
25702570
}
2571-
return RetainReleaseOperatonKind::invalidParameters;
2571+
return RetainReleaseOperationKind::invalidParameters;
25722572
}
2573-
return RetainReleaseOperatonKind::valid;
2573+
return RetainReleaseOperationKind::valid;
25742574
};
25752575

25762576
auto retainOperation = evaluateOrDefault(
@@ -2607,28 +2607,28 @@ namespace {
26072607
false, retainOperation.name, decl->getNameAsString());
26082608
} else if (retainOperation.kind ==
26092609
CustomRefCountingOperationResult::foundOperation) {
2610-
RetainReleaseOperatonKind operationKind =
2610+
RetainReleaseOperationKind operationKind =
26112611
getOperationValidity(retainOperation.operation);
26122612
HeaderLoc loc(decl->getLocation());
26132613
switch (operationKind) {
2614-
case RetainReleaseOperatonKind::notAfunction:
2614+
case RetainReleaseOperationKind::notAfunction:
26152615
Impl.diagnose(
26162616
loc,
26172617
diag::foreign_reference_types_retain_release_not_a_function_decl,
26182618
false, retainOperation.name);
26192619
break;
2620-
case RetainReleaseOperatonKind::doesntReturnVoid:
2620+
case RetainReleaseOperationKind::doesntReturnVoid:
26212621
Impl.diagnose(
26222622
loc,
26232623
diag::foreign_reference_types_retain_release_non_void_return_type,
26242624
false, retainOperation.name);
26252625
break;
2626-
case RetainReleaseOperatonKind::invalidParameters:
2626+
case RetainReleaseOperationKind::invalidParameters:
26272627
Impl.diagnose(loc,
26282628
diag::foreign_reference_types_invalid_retain_release,
26292629
false, retainOperation.name, classDecl->getNameStr());
26302630
break;
2631-
case RetainReleaseOperatonKind::valid:
2631+
case RetainReleaseOperationKind::valid:
26322632
break;
26332633
}
26342634
} else {
@@ -2671,28 +2671,28 @@ namespace {
26712671
true, releaseOperation.name, decl->getNameAsString());
26722672
} else if (releaseOperation.kind ==
26732673
CustomRefCountingOperationResult::foundOperation) {
2674-
RetainReleaseOperatonKind operationKind =
2674+
RetainReleaseOperationKind operationKind =
26752675
getOperationValidity(releaseOperation.operation);
26762676
HeaderLoc loc(decl->getLocation());
26772677
switch (operationKind) {
2678-
case RetainReleaseOperatonKind::notAfunction:
2678+
case RetainReleaseOperationKind::notAfunction:
26792679
Impl.diagnose(
26802680
loc,
26812681
diag::foreign_reference_types_retain_release_not_a_function_decl,
26822682
true, releaseOperation.name);
26832683
break;
2684-
case RetainReleaseOperatonKind::doesntReturnVoid:
2684+
case RetainReleaseOperationKind::doesntReturnVoid:
26852685
Impl.diagnose(
26862686
loc,
26872687
diag::foreign_reference_types_retain_release_non_void_return_type,
26882688
true, releaseOperation.name);
26892689
break;
2690-
case RetainReleaseOperatonKind::invalidParameters:
2690+
case RetainReleaseOperationKind::invalidParameters:
26912691
Impl.diagnose(loc,
26922692
diag::foreign_reference_types_invalid_retain_release,
26932693
true, releaseOperation.name, classDecl->getNameStr());
26942694
break;
2695-
case RetainReleaseOperatonKind::valid:
2695+
case RetainReleaseOperationKind::valid:
26962696
break;
26972697
}
26982698
} else {

0 commit comments

Comments
 (0)