summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/Scope.cpp
diff options
context:
space:
mode:
authorWarren Hunt <whunt@google.com>2014-07-19 00:45:07 +0000
committerWarren Hunt <whunt@google.com>2014-07-19 00:45:07 +0000
commitb530bc0242901d1322d77ce24b64eda10554c35f (patch)
tree782cf0d367af07d228d51d6e278392ae571a023e /clang/lib/Sema/Scope.cpp
parent6971b861d7d33eb87b8cad86555a8e483499299f (diff)
downloadbcm5719-llvm-b530bc0242901d1322d77ce24b64eda10554c35f.tar.gz
bcm5719-llvm-b530bc0242901d1322d77ce24b64eda10554c35f.zip
[MS-ABI] Assign SEH handler indices to __try blocks
Assigns indices to try blocks. These indices will used in constructing tables that the mscrt function __except_handler3 reads during SEH. Testing will occur once we actually emit the tables, in a subsequent patch. llvm-svn: 213437
Diffstat (limited to 'clang/lib/Sema/Scope.cpp')
-rw-r--r--clang/lib/Sema/Scope.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/Sema/Scope.cpp b/clang/lib/Sema/Scope.cpp
index 6c797788238..35e2075b382 100644
--- a/clang/lib/Sema/Scope.cpp
+++ b/clang/lib/Sema/Scope.cpp
@@ -39,6 +39,9 @@ void Scope::Init(Scope *parent, unsigned flags) {
BlockParent = parent->BlockParent;
TemplateParamParent = parent->TemplateParamParent;
MSLocalManglingParent = parent->MSLocalManglingParent;
+ SEHTryParent = parent->SEHTryParent;
+ if (parent->Flags & SEHTryScope)
+ SEHTryParent = parent;
if ((Flags & (FnScope | ClassScope | BlockScope | TemplateParamScope |
FunctionPrototypeScope | AtCatchScope | ObjCMethodScope)) ==
0)
@@ -47,13 +50,17 @@ void Scope::Init(Scope *parent, unsigned flags) {
Depth = 0;
PrototypeDepth = 0;
PrototypeIndex = 0;
- MSLocalManglingParent = FnParent = BlockParent = nullptr;
+ SEHTryParent = MSLocalManglingParent = FnParent = BlockParent = nullptr;
TemplateParamParent = nullptr;
MSLocalManglingNumber = 1;
}
// If this scope is a function or contains breaks/continues, remember it.
if (flags & FnScope) FnParent = this;
+ SEHTryIndexPool = 0;
+ SEHTryIndex = -1;
+ if (flags & SEHTryScope)
+ SEHTryIndex = FnParent ? FnParent->SEHTryIndexPool++ : -1;
// The MS mangler uses the number of scopes that can hold declarations as
// part of an external name.
if (Flags & (ClassScope | FnScope)) {
OpenPOWER on IntegriCloud