diff options
author | Leonard Chan <leonardchan@google.com> | 2018-12-06 00:10:36 +0000 |
---|---|---|
committer | Leonard Chan <leonardchan@google.com> | 2018-12-06 00:10:36 +0000 |
commit | 8a3afc37501d8fa042ae6440ce055b9470fcea1a (patch) | |
tree | ec71b240350d22f7f28ff1c4267ec38642134e5e /lib/Sema/SemaDeclObjC.cpp | |
parent | 57dc61b50d38d361de39ae2cf02ef200eed252e1 (diff) | |
download | clang-8a3afc37501d8fa042ae6440ce055b9470fcea1a.tar.gz |
[Sema] Push and Pop Expression Evaluation Context Records at the start and end of function definitions
This patch creates a new context for every function definition we enter.
Currently we do not push and pop on these, usually working off of the global
context record added in the Sema constructor, which never gets popped.
Differential Revision: https://reviews.llvm.org/D54014
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348434 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index ac1d8cf7a3..5584e181a2 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -363,6 +363,8 @@ void Sema::ActOnStartOfObjCMethodDef(Scope *FnBodyScope, Decl *D) { assert((getCurMethodDecl() == nullptr) && "Methodparsing confused"); ObjCMethodDecl *MDecl = dyn_cast_or_null<ObjCMethodDecl>(D); + PushExpressionEvaluationContext(ExprEvalContexts.back().Context); + // If we don't have a valid method decl, simply return. if (!MDecl) return; |