2727#include " swift/AST/Stmt.h"
2828#include " swift/Basic/OptionSet.h"
2929#include " swift/Parse/Lexer.h"
30- #include " swift/Parse/LocalContext.h"
3130#include " swift/Parse/PersistentParserState.h"
3231#include " swift/Parse/Token.h"
3332#include " swift/Parse/ParserPosition.h"
@@ -176,8 +175,6 @@ class Parser {
176175 bool InInactiveClauseEnvironment = false ;
177176 bool InSwiftKeyPath = false ;
178177
179- LocalContext *CurLocalContext = nullptr ;
180-
181178 // / Whether we should delay parsing nominal type, extension, and function
182179 // / bodies.
183180 bool isDelayedParsingEnabled () const ;
@@ -241,18 +238,15 @@ class Parser {
241238 protected:
242239 Parser &P;
243240 DeclContext *OldContext; // null signals that this has been popped
244- LocalContext *OldLocal;
245241
246242 ContextChange (const ContextChange &) = delete ;
247243 ContextChange &operator =(const ContextChange &) = delete ;
248244
249245 public:
250- ContextChange (Parser &P, DeclContext *DC,
251- LocalContext *newLocal = nullptr )
252- : P(P), OldContext(P.CurDeclContext), OldLocal(P.CurLocalContext) {
246+ ContextChange (Parser &P, DeclContext *DC)
247+ : P(P), OldContext(P.CurDeclContext) {
253248 assert (DC && " pushing null context?" );
254249 P.CurDeclContext = DC;
255- P.CurLocalContext = newLocal;
256250 }
257251
258252 // / Prematurely pop the DeclContext installed by the constructor.
@@ -270,16 +264,15 @@ class Parser {
270264 private:
271265 void popImpl () {
272266 P.CurDeclContext = OldContext;
273- P.CurLocalContext = OldLocal;
274267 }
275268 };
276269
277270 // / A RAII object for parsing a new local context.
278- class ParseFunctionBody : public LocalContext {
271+ class ParseFunctionBody {
279272 private:
280273 ContextChange CC;
281274 public:
282- ParseFunctionBody (Parser &P, DeclContext *DC) : CC(P, DC, this ) {
275+ ParseFunctionBody (Parser &P, DeclContext *DC) : CC(P, DC) {
283276 assert (!isa<TopLevelCodeDecl>(DC) &&
284277 " top-level code should be parsed using TopLevelCodeContext!" );
285278 }
@@ -990,8 +983,7 @@ class Parser {
990983 // / 'isLine = true' indicates parsing #line instead of #sourcelocation
991984 ParserStatus parseLineDirective (bool isLine = false );
992985
993- void setLocalDiscriminator (ValueDecl *D);
994- void setLocalDiscriminatorToParamList (ParameterList *PL);
986+ void recordLocalType (TypeDecl *TD);
995987
996988 // / Skip an `#if` configuration block containing only attributes.
997989 // /
0 commit comments