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 | bf5fe2dbba0899bee4323f5eaa075acc43a18e2e (patch) | |
tree | 7da64aa7b23b86b938988140fce137b5b7d2c663 /clang/lib/Sema/SemaExpr.cpp | |
parent | d4e7d0749bfde91d1f86a1f3adb02079c55a830f (diff) | |
download | bcm5719-llvm-bf5fe2dbba0899bee4323f5eaa075acc43a18e2e.tar.gz bcm5719-llvm-bf5fe2dbba0899bee4323f5eaa075acc43a18e2e.zip |
[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
llvm-svn: 348434
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index de70a78a3b4..304a8079a55 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -14414,11 +14414,8 @@ void Sema::PopExpressionEvaluationContext() { // Pop the current expression evaluation context off the stack. ExprEvalContexts.pop_back(); - if (!ExprEvalContexts.empty()) - ExprEvalContexts.back().NumTypos += NumTypos; - else - assert(NumTypos == 0 && "There are outstanding typos after popping the " - "last ExpressionEvaluationContextRecord"); + // The global expression evaluation context record is never popped. + ExprEvalContexts.back().NumTypos += NumTypos; } void Sema::DiscardCleanupsInEvaluationContext() { |