Skip to content

Commit cb53ca4

Browse files
committed
[cxx-interop] fix typo in RetainReleaseOperationKind enum
1 parent b13544e commit cb53ca4

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
@@ -2534,24 +2534,24 @@ namespace {
25342534
void validateForeignReferenceType(const clang::CXXRecordDecl *decl,
25352535
ClassDecl *classDecl) {
25362536

2537-
enum class RetainReleaseOperatonKind {
2537+
enum class RetainReleaseOperationKind {
25382538
notAfunction,
25392539
doesntReturnVoid,
25402540
invalidParameters,
25412541
valid
25422542
};
25432543

25442544
auto getOperationValidity =
2545-
[&](ValueDecl *operation) -> RetainReleaseOperatonKind {
2545+
[&](ValueDecl *operation) -> RetainReleaseOperationKind {
25462546
auto operationFn = dyn_cast<FuncDecl>(operation);
25472547
if (!operationFn)
2548-
return RetainReleaseOperatonKind::notAfunction;
2548+
return RetainReleaseOperationKind::notAfunction;
25492549

25502550
if (!operationFn->getResultInterfaceType()->isVoid())
2551-
return RetainReleaseOperatonKind::doesntReturnVoid;
2551+
return RetainReleaseOperationKind::doesntReturnVoid;
25522552

25532553
if (operationFn->getParameters()->size() != 1)
2554-
return RetainReleaseOperatonKind::invalidParameters;
2554+
return RetainReleaseOperationKind::invalidParameters;
25552555

25562556
Type paramType =
25572557
operationFn->getParameters()->get(0)->getInterfaceType();
@@ -2568,13 +2568,13 @@ namespace {
25682568
if (const auto *paramTypeDecl =
25692569
dyn_cast<clang::CXXRecordDecl>(paramClangDecl)) {
25702570
if (decl->isDerivedFrom(paramTypeDecl)) {
2571-
return RetainReleaseOperatonKind::valid;
2571+
return RetainReleaseOperationKind::valid;
25722572
}
25732573
}
25742574
}
2575-
return RetainReleaseOperatonKind::invalidParameters;
2575+
return RetainReleaseOperationKind::invalidParameters;
25762576
}
2577-
return RetainReleaseOperatonKind::valid;
2577+
return RetainReleaseOperationKind::valid;
25782578
};
25792579

25802580
auto retainOperation = evaluateOrDefault(
@@ -2611,28 +2611,28 @@ namespace {
26112611
false, retainOperation.name, decl->getNameAsString());
26122612
} else if (retainOperation.kind ==
26132613
CustomRefCountingOperationResult::foundOperation) {
2614-
RetainReleaseOperatonKind operationKind =
2614+
RetainReleaseOperationKind operationKind =
26152615
getOperationValidity(retainOperation.operation);
26162616
HeaderLoc loc(decl->getLocation());
26172617
switch (operationKind) {
2618-
case RetainReleaseOperatonKind::notAfunction:
2618+
case RetainReleaseOperationKind::notAfunction:
26192619
Impl.diagnose(
26202620
loc,
26212621
diag::foreign_reference_types_retain_release_not_a_function_decl,
26222622
false, retainOperation.name);
26232623
break;
2624-
case RetainReleaseOperatonKind::doesntReturnVoid:
2624+
case RetainReleaseOperationKind::doesntReturnVoid:
26252625
Impl.diagnose(
26262626
loc,
26272627
diag::foreign_reference_types_retain_release_non_void_return_type,
26282628
false, retainOperation.name);
26292629
break;
2630-
case RetainReleaseOperatonKind::invalidParameters:
2630+
case RetainReleaseOperationKind::invalidParameters:
26312631
Impl.diagnose(loc,
26322632
diag::foreign_reference_types_invalid_retain_release,
26332633
false, retainOperation.name, classDecl->getNameStr());
26342634
break;
2635-
case RetainReleaseOperatonKind::valid:
2635+
case RetainReleaseOperationKind::valid:
26362636
break;
26372637
}
26382638
} else {
@@ -2675,28 +2675,28 @@ namespace {
26752675
true, releaseOperation.name, decl->getNameAsString());
26762676
} else if (releaseOperation.kind ==
26772677
CustomRefCountingOperationResult::foundOperation) {
2678-
RetainReleaseOperatonKind operationKind =
2678+
RetainReleaseOperationKind operationKind =
26792679
getOperationValidity(releaseOperation.operation);
26802680
HeaderLoc loc(decl->getLocation());
26812681
switch (operationKind) {
2682-
case RetainReleaseOperatonKind::notAfunction:
2682+
case RetainReleaseOperationKind::notAfunction:
26832683
Impl.diagnose(
26842684
loc,
26852685
diag::foreign_reference_types_retain_release_not_a_function_decl,
26862686
true, releaseOperation.name);
26872687
break;
2688-
case RetainReleaseOperatonKind::doesntReturnVoid:
2688+
case RetainReleaseOperationKind::doesntReturnVoid:
26892689
Impl.diagnose(
26902690
loc,
26912691
diag::foreign_reference_types_retain_release_non_void_return_type,
26922692
true, releaseOperation.name);
26932693
break;
2694-
case RetainReleaseOperatonKind::invalidParameters:
2694+
case RetainReleaseOperationKind::invalidParameters:
26952695
Impl.diagnose(loc,
26962696
diag::foreign_reference_types_invalid_retain_release,
26972697
true, releaseOperation.name, classDecl->getNameStr());
26982698
break;
2699-
case RetainReleaseOperatonKind::valid:
2699+
case RetainReleaseOperationKind::valid:
27002700
break;
27012701
}
27022702
} else {

0 commit comments

Comments
 (0)