Skip to content

Commit 26bbd8c

Browse files
committed
[Concurrency] Remove dead ConcurrentValue checking code.
This code got duplicated and customized, but is no longer used.
1 parent 5f6a074 commit 26bbd8c

File tree

1 file changed

+0
-65
lines changed

1 file changed

+0
-65
lines changed

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -793,71 +793,6 @@ static bool isConcurrentValueType(const DeclContext *dc, Type type) {
793793
return checker.visit(type);
794794
}
795795

796-
Optional<NonConcurrentType> NonConcurrentType::get(
797-
const DeclContext *dc, ConcreteDeclRef declRef) {
798-
// For functions, check the parameter and result types.
799-
SubstitutionMap subs = declRef.getSubstitutions();
800-
if (auto function = dyn_cast<AbstractFunctionDecl>(declRef.getDecl())) {
801-
for (auto param : *function->getParameters()) {
802-
Type paramType = param->getInterfaceType().subst(subs);
803-
if (!isConcurrentValueType(dc, paramType)) {
804-
return NonConcurrentType {
805-
Kind::Parameter, ConcreteDeclRef(param, subs), paramType };
806-
}
807-
}
808-
809-
// Check the result type of a function.
810-
if (auto func = dyn_cast<FuncDecl>(function)) {
811-
Type resultType = func->getResultInterfaceType().subst(subs);
812-
if (!isConcurrentValueType(dc, resultType)) {
813-
return NonConcurrentType { Kind::Result, declRef, resultType };
814-
}
815-
}
816-
817-
// Check the "self" type of an instance method.
818-
if (function->isInstanceMember()) {
819-
if (auto selfParam = function->getImplicitSelfDecl()) {
820-
Type paramType = selfParam->getInterfaceType().subst(subs);
821-
if (!isConcurrentValueType(dc, paramType)) {
822-
return NonConcurrentType {
823-
Kind::Parameter, ConcreteDeclRef(selfParam, subs),
824-
paramType };
825-
}
826-
}
827-
}
828-
} else if (auto var = dyn_cast<VarDecl>(declRef.getDecl())) {
829-
Type propertyType = var->getValueInterfaceType().subst(subs);
830-
if (!isConcurrentValueType(dc, propertyType)) {
831-
return NonConcurrentType {
832-
Kind::Property, declRef, propertyType };
833-
}
834-
}
835-
836-
return None;
837-
}
838-
839-
void NonConcurrentType::diagnose(SourceLoc loc) {
840-
ASTContext &ctx = declRef.getDecl()->getASTContext();
841-
842-
switch (kind) {
843-
case Parameter:
844-
ctx.Diags.diagnose(loc, diag::non_concurrent_param_type, type);
845-
break;
846-
847-
case Result:
848-
ctx.Diags.diagnose(loc, diag::non_concurrent_result_type, type);
849-
break;
850-
851-
case Property: {
852-
auto var = cast<VarDecl>(declRef.getDecl());
853-
ctx.Diags.diagnose(loc, diag::non_concurrent_property_type,
854-
var->getDescriptiveKind(), var->getName(),
855-
type, var->isLocalCapture());
856-
break;
857-
}
858-
}
859-
}
860-
861796
static bool diagnoseNonConcurrentParameter(
862797
SourceLoc loc, ConcurrentReferenceKind refKind, ConcreteDeclRef declRef,
863798
ParamDecl *param, Type paramType) {

0 commit comments

Comments
 (0)