@@ -1129,10 +1129,6 @@ static void parseGuardedPattern(Parser &P, GuardedPattern &result,
11291129 boundDecls.push_back (VD);
11301130 });
11311131
1132- // Now that we have them, mark them as being initialized without a PBD.
1133- for (auto VD : boundDecls)
1134- VD->setHasNonPatternBindingInit ();
1135-
11361132 // Parse the optional 'where' guard.
11371133 parseWhereGuard (P, result, status, parsingContext, isExprBasic);
11381134 } else {
@@ -1178,10 +1174,6 @@ static void parseGuardedPattern(Parser &P, GuardedPattern &result,
11781174 status.setIsParseError ();
11791175 }
11801176 }
1181-
1182- for (auto VD : repeatedDecls) {
1183- VD->setHasNonPatternBindingInit ();
1184- }
11851177
11861178 // Parse the optional 'where' guard, with this particular pattern's bound
11871179 // vars in scope.
@@ -1544,7 +1536,6 @@ Parser::parseStmtConditionElement(SmallVectorImpl<StmtConditionElement> &result,
15441536 setLocalDiscriminator (VD);
15451537 if (VD->hasName ())
15461538 addToScope (VD);
1547- VD->setHasNonPatternBindingInit ();
15481539 });
15491540 return Status;
15501541}
@@ -2034,7 +2025,6 @@ ParserResult<CaseStmt> Parser::parseStmtCatch() {
20342025 auto *vNew = new (Context) VarDecl (
20352026 /* IsStatic*/ false , vOld->getIntroducer (),
20362027 vOld->getNameLoc (), vOld->getName (), vOld->getDeclContext ());
2037- vNew->setHasNonPatternBindingInit ();
20382028 vNew->setImplicit ();
20392029 Result[i] = vNew;
20402030 }
@@ -2145,9 +2135,6 @@ ParserResult<Stmt> Parser::parseStmtForEach(LabeledStmtInfo LabelInfo) {
21452135 parseToken (tok::kw_in, InLoc, diag::expected_foreach_in);
21462136 }
21472137
2148- // Bound variables all get their initial values from the generator.
2149- pattern.get ()->markHasNonPatternBindingInit ();
2150-
21512138 if (IsCStyleFor) {
21522139 // Skip until start of body part.
21532140 if (Tok.is (tok::l_paren)) {
@@ -2381,7 +2368,6 @@ parseStmtCase(Parser &P, SourceLoc &CaseLoc,
23812368 auto *vNew = new (P.Context ) VarDecl (
23822369 /* IsStatic*/ false , vOld->getIntroducer (),
23832370 vOld->getNameLoc (), vOld->getName (), vOld->getDeclContext ());
2384- vNew->setHasNonPatternBindingInit ();
23852371 vNew->setImplicit ();
23862372 Result[i] = vNew;
23872373 }
0 commit comments