Add support and getter for index value of local arrays
@@ -50,9 +50,11 @@ public class OCLUnary {
*/
protected static class UnaryConsumer extends OCLLIROp {
- @Opcode protected final OCLUnaryOp opcode;
+ @Opcode
+ protected final OCLUnaryOp opcode;
- @Use protected Value value;
+ @Use
+ protected Value value;
protected UnaryConsumer(OCLUnaryOp opcode, LIRKind lirKind, Value value) {
super(lirKind);
@@ -146,6 +148,7 @@ public class OCLUnary {
private final OCLMemoryBase base;
private final boolean needsBase;
+ private Value index;
public MemoryAccess(OCLMemoryBase base, Value value, boolean needsBase) {
super(null, LIRKind.Illegal, value);
@@ -153,6 +156,13 @@ public class OCLUnary {
this.needsBase = needsBase;
}
+ public MemoryAccess(OCLMemoryBase base, Value value, Value index, boolean needsBase) {
+ super(null, LIRKind.Illegal, value);
+ this.base = base;
+ this.index = index;
+ this.needsBase = needsBase;
+ }
+
@Override
public void emit(OCLCompilationResultBuilder crb, OCLAssembler asm) {
@@ -171,6 +181,10 @@ public class OCLUnary {
return base;
}
+ public Value getIndex() {
+ return index;
+ }
+
@Override
public String toString() {
return String.format("%s", value);
