Mercurial > projects > ldc
comparison ir/irfunction.h @ 1145:40caa8207b3e
Moved IRTargetScopeS from IRState into IrFunction, fixes #240 .
author | Tomas Lindquist Olsen <tomas.l.olsen gmail.com> |
---|---|
date | Thu, 26 Mar 2009 18:46:21 +0100 |
parents | dc608dc33081 |
children | 8699c450a1a0 |
comparison
equal
deleted
inserted
replaced
1144:cdda73cf2f8a | 1145:40caa8207b3e |
---|---|
6 #include "ir/irlandingpad.h" | 6 #include "ir/irlandingpad.h" |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 #include <stack> | 9 #include <stack> |
10 #include <map> | 10 #include <map> |
11 | |
12 struct Statement; | |
13 struct EnclosingHandler; | |
14 | |
15 // scope statements that can be target of jumps | |
16 // includes loops, switch, case, labels | |
17 struct IRTargetScope | |
18 { | |
19 // generating statement | |
20 Statement* s; | |
21 | |
22 // the try of a TryFinally that encloses the loop | |
23 EnclosingHandler* enclosinghandler; | |
24 | |
25 llvm::BasicBlock* breakTarget; | |
26 llvm::BasicBlock* continueTarget; | |
27 | |
28 IRTargetScope(); | |
29 IRTargetScope(Statement* s, EnclosingHandler* enclosinghandler, llvm::BasicBlock* continueTarget, llvm::BasicBlock* breakTarget); | |
30 }; | |
11 | 31 |
12 // represents a function | 32 // represents a function |
13 struct IrFunction : IrBase | 33 struct IrFunction : IrBase |
14 { | 34 { |
15 llvm::Function* func; | 35 llvm::Function* func; |
46 LabelToBBMap labelToBB; | 66 LabelToBBMap labelToBB; |
47 | 67 |
48 // landing pads for try statements | 68 // landing pads for try statements |
49 IRLandingPad landingPad; | 69 IRLandingPad landingPad; |
50 | 70 |
71 // loop blocks | |
72 typedef std::vector<IRTargetScope> TargetScopeVec; | |
73 TargetScopeVec targetScopes; | |
74 | |
75 // constructor | |
51 IrFunction(FuncDeclaration* fd); | 76 IrFunction(FuncDeclaration* fd); |
52 | 77 |
53 // annotations | 78 // annotations |
54 void setNeverInline(); | 79 void setNeverInline(); |
55 void setAlwaysInline(); | 80 void setAlwaysInline(); |