File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -199,6 +199,7 @@ class VariableCollection
199199 }
200200
201201 this .variables ~= variable;
202+ const bool isLocal = (variable.visibility == Compiler.VIS_LOCAL );
202203
203204 // Add the variable to the intermediate code
204205 if (! variable.isConst && ! variable.isDynamic) {
@@ -207,7 +208,7 @@ class VariableCollection
207208 // Need one more byte for strings
208209 length += (variable.dimensions[0 ] * variable.dimensions[1 ] * variable.dimensions[2 ]);
209210 }
210- string code;
211+ string code = " " ;
211212 if (variable.isExplicitAddr || variable.isFast) {
212213 if (variable.addressLabel != " " ) {
213214 code = variable.getAsmLabel() ~ " EQU " ~ variable.addressLabel ~ " \n " ;
@@ -217,8 +218,15 @@ class VariableCollection
217218 }
218219 }
219220 else {
220- code = variable.getAsmLabel() ~ " DS.B " ~ to! string (length) ~ " \n " ;
221+ if (isLocal) {
222+ code ~= " \t IFCONST I_" ~ compiler.currentProc.getLabel() ~ " _IMPORTED\n " ;
223+ }
224+ code ~= variable.getAsmLabel() ~ " DS.B " ~ to! string (length) ~ " \n " ;
225+ if (isLocal) {
226+ code ~= " \t ENDIF\n " ;
227+ }
221228 }
229+
222230 this .compiler.getImCode().appendSegment(IntermediateCode.VAR_SEGMENT , code);
223231 }
224232 }
You can’t perform that action at this time.
0 commit comments