@@ -2043,12 +2043,6 @@ Parser::parseDecl(ParseDeclOptions Flags,
2043
2043
return IfConfigResult;
2044
2044
}
2045
2045
2046
- Decl* LastDecl = nullptr ;
2047
- auto InternalHandler = [&](Decl *D) {
2048
- LastDecl = D;
2049
- Handler (D);
2050
- };
2051
-
2052
2046
ParserPosition BeginParserPosition;
2053
2047
if (isCodeCompletionFirstPass ())
2054
2048
BeginParserPosition = getParserPosition ();
@@ -2244,7 +2238,7 @@ Parser::parseDecl(ParseDeclOptions Flags,
2244
2238
StaticSpelling, tryLoc);
2245
2239
StaticLoc = SourceLoc (); // we handled static if present.
2246
2240
MayNeedOverrideCompletion = true ;
2247
- std::for_each (Entries.begin (), Entries.end (), InternalHandler );
2241
+ std::for_each (Entries.begin (), Entries.end (), Handler );
2248
2242
if (auto *D = DeclResult.getPtrOrNull ())
2249
2243
markWasHandled (D);
2250
2244
break ;
@@ -2262,7 +2256,7 @@ Parser::parseDecl(ParseDeclOptions Flags,
2262
2256
case tok::kw_case: {
2263
2257
llvm::SmallVector<Decl *, 4 > Entries;
2264
2258
DeclResult = parseDeclEnumCase (Flags, Attributes, Entries);
2265
- std::for_each (Entries.begin (), Entries.end (), InternalHandler );
2259
+ std::for_each (Entries.begin (), Entries.end (), Handler );
2266
2260
if (auto *D = DeclResult.getPtrOrNull ())
2267
2261
markWasHandled (D);
2268
2262
break ;
@@ -2300,7 +2294,7 @@ Parser::parseDecl(ParseDeclOptions Flags,
2300
2294
}
2301
2295
llvm::SmallVector<Decl *, 4 > Entries;
2302
2296
DeclResult = parseDeclSubscript (Flags, Attributes, Entries);
2303
- std::for_each (Entries.begin (), Entries.end (), InternalHandler );
2297
+ std::for_each (Entries.begin (), Entries.end (), Handler );
2304
2298
MayNeedOverrideCompletion = true ;
2305
2299
if (auto *D = DeclResult.getPtrOrNull ())
2306
2300
markWasHandled (D);
@@ -2375,7 +2369,7 @@ Parser::parseDecl(ParseDeclOptions Flags,
2375
2369
if (DeclResult.isNonNull ()) {
2376
2370
Decl *D = DeclResult.get ();
2377
2371
if (!declWasHandledAlready (D))
2378
- InternalHandler (DeclResult.get ());
2372
+ Handler (DeclResult.get ());
2379
2373
}
2380
2374
2381
2375
if (!DeclResult.isParseError ()) {
0 commit comments