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

@@ -36,7 +36,6 @@ struct Module;
struct TypeStruct;
struct BaseClass;
struct AnonDeclaration;
struct EnclosingHandler;
struct IrModule;
@@ -51,23 +50,6 @@ struct IRScope
IRScope(llvm::BasicBlock* b, llvm::BasicBlock* e);
};
// 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);
};
struct IRBuilderHelper
{
IRState* state;
@@ -159,10 +141,6 @@ struct IRState
llvm::CallSite CreateCallOrInvoke3(LLValue* Callee, LLValue* Arg1, LLValue* Arg2, LLValue* Arg3, const char* Name="");
llvm::CallSite CreateCallOrInvoke4(LLValue* Callee, LLValue* Arg1, LLValue* Arg2, LLValue* Arg3, LLValue* Arg4, const char* Name="");
// loop blocks
typedef std::vector<IRTargetScope> TargetScopeVec;
TargetScopeVec targetScopes;
// 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
// VarDeclaration for __dollar, but I can't see how to get the