Mercurial > projects > ldc
comparison gen/irstate.cpp @ 309:d59c363fccad trunk
[svn r330] Implemented synchronized statements.
Changed the tryfinally handlers to a more generalized EnclosingHandler.
Changed ClassInfoS to be mutable so they can be used as locks.
Added new BB after throw ala return/break etc.
author | lindquist |
---|---|
date | Sat, 28 Jun 2008 11:37:53 +0200 |
parents | 88252a1af660 |
children | 9967a3270837 |
comparison
equal
deleted
inserted
replaced
308:6b62e8cdf970 | 309:d59c363fccad |
---|---|
8 | 8 |
9 #include "gen/llvm.h" | 9 #include "gen/llvm.h" |
10 | 10 |
11 #include "mtype.h" | 11 #include "mtype.h" |
12 #include "declaration.h" | 12 #include "declaration.h" |
13 #include "statement.h" | |
13 | 14 |
14 #include "gen/irstate.h" | 15 #include "gen/irstate.h" |
15 #include "tollvm.h" | 16 #include "tollvm.h" |
16 | 17 |
17 IRState* gIR = 0; | 18 IRState* gIR = 0; |
33 ////////////////////////////////////////////////////////////////////////////////////////// | 34 ////////////////////////////////////////////////////////////////////////////////////////// |
34 IRLoopScope::IRLoopScope() | 35 IRLoopScope::IRLoopScope() |
35 { | 36 { |
36 } | 37 } |
37 | 38 |
38 IRLoopScope::IRLoopScope(Statement* s, TryFinallyStatement* enclosingtryfinally, llvm::BasicBlock* b, llvm::BasicBlock* e) | 39 IRLoopScope::IRLoopScope(Statement* s, EnclosingHandler* enclosinghandler, llvm::BasicBlock* b, llvm::BasicBlock* e) |
39 { | 40 { |
40 begin = b; | 41 begin = b; |
41 end = e; | 42 end = e; |
42 //builder.SetInsertPoint(b); | 43 //builder.SetInsertPoint(b); |
43 this->s = s; | 44 this->s = s; |
44 this->enclosingtryfinally = enclosingtryfinally; | 45 this->enclosinghandler = enclosinghandler; |
45 } | 46 } |
46 | 47 |
47 ////////////////////////////////////////////////////////////////////////////////////////// | 48 ////////////////////////////////////////////////////////////////////////////////////////// |
48 IRState::IRState() | 49 IRState::IRState() |
49 { | 50 { |
50 interfaceInfoType = NULL; | 51 interfaceInfoType = NULL; |
52 mutexType = NULL; | |
53 | |
51 dmodule = 0; | 54 dmodule = 0; |
52 module = 0; | 55 module = 0; |
53 emitMain = false; | 56 emitMain = false; |
54 mainFunc = 0; | 57 mainFunc = 0; |
55 ir.state = this; | 58 ir.state = this; |