summaryrefslogtreecommitdiffstats
path: root/lib/Sema/Scope.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2014-07-06 22:53:19 +0000
committerNico Weber <nicolasweber@gmx.de>2014-07-06 22:53:19 +0000
commitf16104c81cd0dff21d9c4e48dd7f827683317bff (patch)
tree8e848041bee84993afefeca34231ba0ba7552543 /lib/Sema/Scope.cpp
parent695370c70118fc7d19e5d6b1f709095c4f4768a7 (diff)
Sema: Check that __leave is contained in a __try block.
Give scope a SEHTryScope bit, set that in ParseSEHTry(), and let Sema walk the scope chain to find the SEHTry parent on __leave statements. (They are rare enough that it seems better to do the walk instead of giving Scope a SEHTryParent pointer -- this is similar to AtCatchScope.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212422 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Scope.cpp')
-rw-r--r--lib/Sema/Scope.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/Scope.cpp b/lib/Sema/Scope.cpp
index c49133d472..6c79778823 100644
--- a/lib/Sema/Scope.cpp
+++ b/lib/Sema/Scope.cpp
@@ -182,6 +182,9 @@ void Scope::dumpImpl(raw_ostream &OS) const {
} else if (Flags & FnTryCatchScope) {
OS << "FnTryCatchScope";
Flags &= ~FnTryCatchScope;
+ } else if (Flags & SEHTryScope) {
+ OS << "SEHTryScope";
+ Flags &= ~SEHTryScope;
} else if (Flags & OpenMPDirectiveScope) {
OS << "OpenMPDirectiveScope";
Flags &= ~OpenMPDirectiveScope;