1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-12-22 21:29:50 +00:00

Renamed non-relocatable variables to hardware/hardcoded. #712

This commit is contained in:
Jesper Gravgaard 2021-09-23 07:49:19 +02:00
parent 74cc8bd1f6
commit 1f91617ad1
2 changed files with 17 additions and 17 deletions

View File

@ -67,7 +67,7 @@ public class Registers {
int getBytes(); int getBytes();
boolean isNonRelocatable(); boolean isAddressHardcoded();
boolean isHardware(); boolean isHardware();
} }
@ -82,13 +82,13 @@ public class Registers {
private Long address; private Long address;
/** True if the address of the register is declared in the code (non-relocatable) */ /** True if the address of the register is declared in the code (non-relocatable) */
private boolean nonRelocatable; private boolean addressHardcoded;
public RegisterMainMem(VariableRef variableRef, int bytes, Long address, boolean nonRelocatable) { public RegisterMainMem(VariableRef variableRef, int bytes, Long address, boolean addressHardcoded) {
this.variableRef = variableRef; this.variableRef = variableRef;
this.bytes = bytes; this.bytes = bytes;
this.address = address; this.address = address;
this.nonRelocatable = nonRelocatable; this.addressHardcoded = addressHardcoded;
} }
public VariableRef getVariableRef() { public VariableRef getVariableRef() {
@ -119,8 +119,8 @@ public class Registers {
} }
@Override @Override
public boolean isNonRelocatable() { public boolean isAddressHardcoded() {
return nonRelocatable; return addressHardcoded;
} }
@Override @Override
@ -164,12 +164,12 @@ public class Registers {
private int zp; private int zp;
/** True if the address of the register is declared in the code (non-relocatable) */ /** True if the address of the register is declared in the code (non-relocatable) */
private boolean nonRelocatable; private boolean addressHardcoded;
public RegisterZpMem(int zp, int bytes, boolean nonRelocatable) { public RegisterZpMem(int zp, int bytes, boolean addressHardcoded) {
this.zp = zp; this.zp = zp;
this.bytes = bytes; this.bytes = bytes;
this.nonRelocatable = nonRelocatable; this.addressHardcoded = addressHardcoded;
} }
public RegisterZpMem(int zp, int bytes) { public RegisterZpMem(int zp, int bytes) {
@ -194,8 +194,8 @@ public class Registers {
return bytes; return bytes;
} }
public boolean isNonRelocatable() { public boolean isAddressHardcoded() {
return nonRelocatable; return addressHardcoded;
} }
@Override @Override
@ -220,7 +220,7 @@ public class Registers {
RegisterZpMem that = (RegisterZpMem) o; RegisterZpMem that = (RegisterZpMem) o;
return zp == that.zp && return zp == that.zp &&
bytes == that.bytes && bytes == that.bytes &&
nonRelocatable == that.nonRelocatable; addressHardcoded == that.addressHardcoded;
} }
@Override @Override
@ -245,8 +245,8 @@ public class Registers {
} }
@Override @Override
public boolean isNonRelocatable() { public boolean isAddressHardcoded() {
return true; return false;
} }
@Override @Override
@ -367,7 +367,7 @@ public class Registers {
} }
@Override @Override
public boolean isNonRelocatable() { public boolean isAddressHardcoded() {
return false; return false;
} }

View File

@ -170,8 +170,8 @@ public class Pass4RegistersFinalize extends Pass2Base {
if(register.isHardware()) { if(register.isHardware()) {
// Do not allocate hardware registers // Do not allocate hardware registers
reallocate = false; reallocate = false;
} else if(register.isNonRelocatable()) { } else if(register.isAddressHardcoded()) {
// Do not allocate non-relocatable ZP registers // Do not allocate registers with hardcoded address
reallocate = false; reallocate = false;
} }
} }