diff gen/irstate.h @ 145:8f704cb9969b trunk

[svn r150] fixes #16 and #17, implements GotoCaseStatement
author ChristianK
date Sat, 08 Mar 2008 15:22:07 +0100
parents 0e28624814e8
children 86d3bb8ca33e
line wrap: on
line diff
--- a/gen/irstate.h	Sat Jan 26 17:13:22 2008 +0100
+++ b/gen/irstate.h	Sat Mar 08 15:22:07 2008 +0100
@@ -23,6 +23,7 @@
 struct Module;
 struct TypeStruct;
 struct BaseClass;
+struct TryFinallyStatement;
 
 // represents a scope
 struct IRScope
@@ -35,6 +36,18 @@
     IRScope(llvm::BasicBlock* b, llvm::BasicBlock* e);
 };
 
+// scope for loops
+struct IRLoopScope : IRScope
+{
+    // generating statement
+    Statement* s;
+    // the try of a TryFinally that encloses the loop
+    TryFinallyStatement* enclosingtry;
+
+    IRLoopScope();
+    IRLoopScope(Statement* s, TryFinallyStatement* enclosingtry, llvm::BasicBlock* b, llvm::BasicBlock* e);
+};
+
 struct IRBuilderHelper
 {
     IRState* state;
@@ -95,7 +108,8 @@
 
     // loop blocks
     typedef std::vector<IRScope> BBVec;
-    BBVec loopbbs;
+    typedef std::vector<IRLoopScope> LoopScopeVec;
+    LoopScopeVec loopbbs;
 
     // this holds the array being indexed or sliced so $ will work
     // might be a better way but it works. problem is I only get a