Moved IRTargetScopeS from IRState into IrFunction, fixes #240 .

This commit is contained in:
Tomas Lindquist Olsen
2009-03-26 18:46:21 +01:00
parent 91698fd0a5
commit 367b8da8f4
4 changed files with 71 additions and 57 deletions

View File

@@ -9,6 +9,26 @@
#include <stack>
#include <map>
struct Statement;
struct EnclosingHandler;
// scope statements that can be target of jumps
// includes loops, switch, case, labels
struct IRTargetScope
{
// generating statement
Statement* s;
// the try of a TryFinally that encloses the loop
EnclosingHandler* enclosinghandler;
llvm::BasicBlock* breakTarget;
llvm::BasicBlock* continueTarget;
IRTargetScope();
IRTargetScope(Statement* s, EnclosingHandler* enclosinghandler, llvm::BasicBlock* continueTarget, llvm::BasicBlock* breakTarget);
};
// represents a function
struct IrFunction : IrBase
{
@@ -48,6 +68,11 @@ struct IrFunction : IrBase
// landing pads for try statements
IRLandingPad landingPad;
// loop blocks
typedef std::vector<IRTargetScope> TargetScopeVec;
TargetScopeVec targetScopes;
// constructor
IrFunction(FuncDeclaration* fd);
// annotations