mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 08:33:14 +01:00
Moved IRTargetScopeS from IRState into IrFunction, fixes #240 .
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user