comparison dmd/IRState.d @ 178:e3afd1303184

Many small bugs fixed Made all classes derive from TObject to detect memory leaks (functionality is disabled for now) Began work on overriding backend memory allocations (to avoid memory leaks)
author korDen
date Sun, 17 Oct 2010 07:42:00 +0400
parents 60bb0fe4563e
children
comparison
equal deleted inserted replaced
177:1475fd394c9e 178:e3afd1303184
54 sthis = irs.sthis; 54 sthis = irs.sthis;
55 blx = irs.blx; 55 blx = irs.blx;
56 deferToObj = irs.deferToObj; 56 deferToObj = irs.deferToObj;
57 } 57 }
58 } 58 }
59 59
60 this(IRState* irs, Dsymbol s) 60 this(IRState* irs, Dsymbol s)
61 { 61 {
62 assert(false); 62 assert(false);
63 } 63 }
64 64
65 this(Module m, Dsymbol s) 65 this(Module m, Dsymbol s)
66 { 66 {
67 this.m = m; 67 this.m = m;
68 symbol = s; 68 symbol = s;
69 } 69 }
80 else if (bc.breakBlock) 80 else if (bc.breakBlock)
81 return bc.breakBlock; 81 return bc.breakBlock;
82 } 82 }
83 return null; 83 return null;
84 } 84 }
85 85
86 block* getContBlock(Identifier ident) 86 block* getContBlock(Identifier ident)
87 { 87 {
88 IRState* bc; 88 IRState* bc;
89 89
90 for (bc = &this; bc; bc = bc.prev) 90 for (bc = &this; bc; bc = bc.prev)
97 else if (bc.contBlock) 97 else if (bc.contBlock)
98 return bc.contBlock; 98 return bc.contBlock;
99 } 99 }
100 return null; 100 return null;
101 } 101 }
102 102
103 block* getSwitchBlock() 103 block* getSwitchBlock()
104 { 104 {
105 for (IRState* bc = &this; bc; bc = bc.prev) 105 for (IRState* bc = &this; bc; bc = bc.prev)
106 { 106 {
107 if (bc.switchBlock) 107 if (bc.switchBlock)
108 return bc.switchBlock; 108 return bc.switchBlock;
109 } 109 }
110 return null; 110 return null;
111 } 111 }
112 112
113 block* getDefaultBlock() 113 block* getDefaultBlock()
114 { 114 {
115 for (IRState* bc = &this; bc; bc = bc.prev) 115 for (IRState* bc = &this; bc; bc = bc.prev)
116 { 116 {
117 if (bc.defaultBlock) 117 if (bc.defaultBlock)
118 return bc.defaultBlock; 118 return bc.defaultBlock;
119 } 119 }
120 return null; 120 return null;
121 } 121 }
122 122
123 FuncDeclaration getFunc() 123 FuncDeclaration getFunc()
124 { 124 {
125 IRState* bc; 125 IRState* bc;
126 for (bc = &this; bc.prev; bc = bc.prev) 126 for (bc = &this; bc.prev; bc = bc.prev)
127 { 127 {