[PATCH] Assign SEH handler indices to __try blocks

David Majnemer david.majnemer at gmail.com
Fri Jul 18 17:25:21 PDT 2014


LGTM with the comments addressed.

================
Comment at: include/clang/AST/Stmt.h:1895-1896
@@ -1894,2 +1894,4 @@
   Stmt           *Children[2];
+  int HandlerIndex;
+  int HandlerParentIndex;
 
----------------
Can these be aligned with the fields above?

================
Comment at: lib/Parse/ParseStmt.cpp:1990-2000
@@ +1989,13 @@
+  {
+    assert(Tok.is(tok::l_brace) && "Not a compount stmt!");
+
+    // Enter a scope to hold everything within the compound stmt.  Compound
+    // statements can always hold declarations.
+    ParseScope CompoundScope(this, Scope::DeclScope | Scope::TryScope |
+      (FnTry ? Scope::FnTryCatchScope : 0));
+    SEHTryIndex = getCurScope()->getSEHTryIndex();
+    SEHTryParentIndex = getCurScope()->getSEHTryParentIndex();
+
+    // Parse the statements in the body.
+    TryBlock = ParseCompoundStatementBody();
+  }
----------------
This doesn't look correctly formatted, can you run this through clang-format?

http://reviews.llvm.org/D4593






More information about the cfe-commits mailing list