1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-12-26 18:29:54 +00:00

Now using VariableBuilderConfig for setting up SSA/MA & MemoryArea.

This commit is contained in:
jespergravgaard 2020-02-09 12:44:36 +01:00
parent eed8d58d74
commit c8523c488e

View File

@ -295,12 +295,15 @@ public class VariableBuilder {
return (addressDirective.address < 0x100) ? Variable.MemoryArea.ZEROPAGE_MEMORY : Variable.MemoryArea.MAIN_MEMORY;
else if(!isConstant() && isOptimize())
return Variable.MemoryArea.ZEROPAGE_MEMORY;
else if(isArray())
return Variable.MemoryArea.MAIN_MEMORY;
else if(isTypeStruct() && isScopeGlobal())
return Variable.MemoryArea.MAIN_MEMORY;
else
return Variable.MemoryArea.ZEROPAGE_MEMORY;
else {
VariableBuilderConfig.Scope scope = VariableBuilderConfig.getScope(isScopeGlobal(), isScopeLocal(), isScopeParameter(), isScopeMember());
VariableBuilderConfig.Type type = VariableBuilderConfig.getType(isTypeInteger(), isArray(), isTypePointer(), isTypeStruct());
VariableBuilderConfig.Setting setting = config.getSetting(scope, type);
if(setting!=null && VariableBuilderConfig.MemoryArea.MEM.equals(setting.memoryArea))
return Variable.MemoryArea.MAIN_MEMORY;
else
return Variable.MemoryArea.ZEROPAGE_MEMORY;
}
}
/**