aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2026-04-04 10:27:06 +0100
committerMichael Williamson <mike@zwobble.org>2026-04-04 10:28:17 +0100
commitd68a12290bc715e5dea98186a47d84f0b0dfcdef (patch)
treea879c8c8c7ebd8cbba48db5ca6b771c923831037
parent58fb4a1352c8667bf627ded1ac4171cd568dcf37 (diff)
Rename offset field to elementOffsets
-rw-r--r--flatbuffers/patio.fbs6
-rw-r--r--patio-to-cranelift/src/patio/flatbuffers.rs2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioCallTests]/[method:canCallFunctionWithArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioCallTests]/[method:canCallFunctionWithNoArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDeclareNativeFunctionTests]/[method:canDeclareNativeFunction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineEffectTests]/[method:canGenerateCodeForDefineEffect(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected16
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:canCaptureFreeVariablesThatAreSetAfterDefinition(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected14
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:canDefineMinimalFunction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected6
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:immutableFreeVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected14
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected14
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:positionalAndNamedParamsAreDefined(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected14
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructNonPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected12
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected12
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioFieldLoadTests]/[method:canGenerateCodeForNamespaceFieldLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioFieldLoadTests]/[method:canGenerateCodeForStructFieldLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioFieldLoadTests]/[method:canGenerateCodeForUserDefinedEffectFieldLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioMethodLoadTests]/[method:canGenerateCodeForMethodLoadInDifferentNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioMethodLoadTests]/[method:canGenerateCodeForMethodLoadInSameNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioMethodStoreTests]/[method:canGenerateCodeForMethodStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioNamespaceFieldStoreTests]/[method:canGenerateCodeForNamespaceFieldStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected4
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioNamespaceTests]/[method:canDefineNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected14
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioSwitchTests]/[method:canGenerateCodeForSwitchWithSingleResult(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTryTests]/[method:canGenerateCodeForTry(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected12
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTryTests]/[method:effectHandlerIsPoppedBeforeReturn(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected4
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTupleCreateTests]/[method:canGenerateCodeForTupleCreate(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected12
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTupleGetTests]/[method:canGenerateCodeForTupleGet(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioVarLoadTests]/[method:canGenerateCodeForVarLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioVarStoreTests]/[method:canGenerateCodeForVarStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioVarStoreTests]/[method:canStoreIntoVarMultipleTimes(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected4
-rw-r--r--src/main/java/org/shedlang/compiler/backends/llvm/codegen/PatioToLlvm.java36
-rw-r--r--src/main/java/org/shedlang/compiler/backends/wasm/PatioToWasm.java6
-rw-r--r--src/main/java/org/shedlang/compiler/patio/PatioSerializer.java10
-rw-r--r--src/main/java/org/shedlang/compiler/patio/instructions/PatioMemoryLoad.java2
-rw-r--r--src/main/java/org/shedlang/compiler/patio/instructions/PatioMemoryStore.java2
-rw-r--r--src/main/java/org/shedlang/compiler/patio/serialization/PatioToFlatbuffers.java30
-rw-r--r--src/main/java/org/shedlang/compiler/patio/values/PatioIntValueByteOffsetOf.java2
-rw-r--r--src/test/java/org/shedlang/compiler/patio/PatioSerializerTests.java4
38 files changed, 140 insertions, 140 deletions
diff --git a/flatbuffers/patio.fbs b/flatbuffers/patio.fbs
index 1d7c7958..b7715cd1 100644
--- a/flatbuffers/patio.fbs
+++ b/flatbuffers/patio.fbs
@@ -78,7 +78,7 @@ table PatioIntValue {
table PatioIntValueByteOffsetOf {
layout:PatioDataLayout (required);
- offset:[uint] (required);
+ element_offsets:[uint] (required);
}
table PatioIntValueByteSizeOf {
@@ -355,14 +355,14 @@ table PatioMemoryLoad {
destination:PatioLocalRef (required);
pointer:PatioOperand (required);
layout:PatioDataLayout (required);
- offset:[uint] (required);
+ element_offsets:[uint] (required);
}
table PatioMemoryStore {
source:Sources.Source (required);
pointer:PatioOperand (required);
layout:PatioDataLayout (required);
- offset:[uint] (required);
+ element_offsets:[uint] (required);
value:PatioOperand (required);
}
diff --git a/patio-to-cranelift/src/patio/flatbuffers.rs b/patio-to-cranelift/src/patio/flatbuffers.rs
index 64e8b569..f1867a7b 100644
--- a/patio-to-cranelift/src/patio/flatbuffers.rs
+++ b/patio-to-cranelift/src/patio/flatbuffers.rs
@@ -329,7 +329,7 @@ impl From<patio_generated::patio::PatioIntValue<'_>> for PatioIntValue {
let byte_offset_of = value.value_as_patio_int_value_byte_offset_of().unwrap();
Self::ByteOffsetOf {
layout: byte_offset_of.layout().into(),
- element_offsets: byte_offset_of.offset().iter().collect(),
+ element_offsets: byte_offset_of.element_offsets().iter().collect(),
}
}
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioCallTests]/[method:canCallFunctionWithArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioCallTests]/[method:canCallFunctionWithArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 5301402e..f49908e2 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioCallTests]/[method:canCallFunctionWithArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioCallTests]/[method:canCallFunctionWithArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -25,7 +25,7 @@ Instructions:
(local "callFunctionPointer__0")
pointer=(local "closurePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr))))
- offset=(1 0)
+ element-offsets=(1 0)
)
(call-pointer (local "tmp__0") (local "callFunctionPointer__0") ((local "closurePointer__0") (local "callArgPositional__0__0") (local "callArgPositional__1__0") (local "callArgNamed__a__0") (local "callArgNamed__b__0")))
)
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioCallTests]/[method:canCallFunctionWithNoArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioCallTests]/[method:canCallFunctionWithNoArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 03c6feac..1c00544f 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioCallTests]/[method:canCallFunctionWithNoArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioCallTests]/[method:canCallFunctionWithNoArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -17,7 +17,7 @@ Instructions:
(local "callFunctionPointer__0")
pointer=(local "closurePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr))))
- offset=(1 0)
+ element-offsets=(1 0)
)
(call-pointer (local "tmp__0") (local "callFunctionPointer__0") ((local "closurePointer__0")))
)
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDeclareNativeFunctionTests]/[method:canDeclareNativeFunction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDeclareNativeFunctionTests]/[method:canDeclareNativeFunction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 517d78e9..79bf224b 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDeclareNativeFunctionTests]/[method:canDeclareNativeFunction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDeclareNativeFunctionTests]/[method:canDeclareNativeFunction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -25,7 +25,7 @@ Instructions:
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct ())))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(function-ptr-const "shed__runtime__namespace__Example__Project__f")
)
(data-ptr-to-int (local "closure__f__0") (local "closurePointer__f__0"))
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineEffectTests]/[method:canGenerateCodeForDefineEffect(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineEffectTests]/[method:canGenerateCodeForDefineEffect(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index f1fa118c..886829fb 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineEffectTests]/[method:canGenerateCodeForDefineEffect(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineEffectTests]/[method:canGenerateCodeForDefineEffect(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -34,7 +34,7 @@ Compilation unit elements:
(local "callFunctionPointer__0")
pointer=(local "closurePointer__1")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr))))
- offset=(1 0)
+ element-offsets=(1 0)
)
(call-pointer (local "tmp__0") (local "callFunctionPointer__0") ((local "closurePointer__1") (local "local__fence")))
(return (local "tmp__0"))
@@ -55,7 +55,7 @@ Compilation unit elements:
(local "callFunctionPointer__0")
pointer=(local "closurePointer__1")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr))))
- offset=(1 0)
+ element-offsets=(1 0)
)
(call-pointer (local "tmp__0") (local "callFunctionPointer__0") ((local "closurePointer__1") (local "local__arg0")))
(return (local "tmp__0"))
@@ -78,14 +78,14 @@ Instructions:
memory-store
pointer=(local "userDefinedEffectPointer__State__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(int-const 0)
)
(
memory-store
pointer=(local "userDefinedEffectPointer__State__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int))))
- offset=(1 1)
+ element-offsets=(1 1)
value=(int-const 0)
)
(call (local "closurePointer__read__0") "shed__runtime__gc_alloc" ((int-const (byte-size-of (struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct ()))))))) (int32-const 5)))
@@ -93,7 +93,7 @@ Instructions:
memory-store
pointer=(local "closurePointer__read__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct ())))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(function-ptr-const "shed__function__read__0")
)
(data-ptr-to-int (local "userDefinedMethod__read__0") (local "closurePointer__read__0"))
@@ -101,7 +101,7 @@ Instructions:
memory-store
pointer=(local "userDefinedEffectPointer__State__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(local "userDefinedMethod__read__0")
)
(call (local "closurePointer__write__0") "shed__runtime__gc_alloc" ((int-const (byte-size-of (struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct ()))))))) (int32-const 5)))
@@ -109,7 +109,7 @@ Instructions:
memory-store
pointer=(local "closurePointer__write__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct ())))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(function-ptr-const "shed__function__write__0")
)
(data-ptr-to-int (local "userDefinedMethod__write__0") (local "closurePointer__write__0"))
@@ -117,7 +117,7 @@ Instructions:
memory-store
pointer=(local "userDefinedEffectPointer__State__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int))))
- offset=(1 1)
+ element-offsets=(1 1)
value=(local "userDefinedMethod__write__0")
)
(data-ptr-to-int (local "userDefinedEffect__State__0") (local "userDefinedEffectPointer__State__0"))
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:canCaptureFreeVariablesThatAreSetAfterDefinition(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:canCaptureFreeVariablesThatAreSetAfterDefinition(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 3d416b9f..875a787c 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:canCaptureFreeVariablesThatAreSetAfterDefinition(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:canCaptureFreeVariablesThatAreSetAfterDefinition(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -30,14 +30,14 @@ Compilation unit elements:
(local "local__a")
pointer=(local "closurePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 0)
+ element-offsets=(1 2 0)
)
(
memory-load
(local "local__b")
pointer=(local "closurePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 1)
+ element-offsets=(1 2 1)
)
(call (local "gcRootStackIndex__0") "shed__runtime__gc_get_root_stack_index" ())
(call _ "shed__runtime__gc_set_root_stack_index" ((local "gcRootStackIndex__0")))
@@ -66,21 +66,21 @@ Instructions:
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 0)
+ element-offsets=(1 2 0)
value=(int-const 0)
)
(
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 1)
+ element-offsets=(1 2 1)
value=(int-const 0)
)
(
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(function-ptr-const "shed__function__f__0")
)
(data-ptr-to-int (local "closure__f__0") (local "closurePointer__f__0"))
@@ -89,7 +89,7 @@ Instructions:
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 0)
+ element-offsets=(1 2 0)
value=(local "local__a")
)
(local-store (local "b") (int-const 47))
@@ -97,7 +97,7 @@ Instructions:
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 1)
+ element-offsets=(1 2 1)
value=(local "local__b")
)
)
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:canDefineMinimalFunction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:canDefineMinimalFunction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 62db57f4..f6264ebf 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:canDefineMinimalFunction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:canDefineMinimalFunction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -51,7 +51,7 @@ Instructions:
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct ())))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(function-ptr-const "shed__function__f__0")
)
(data-ptr-to-int (local "closure__f__0") (local "closurePointer__f__0"))
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index fb905480..a8c929d9 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -44,7 +44,7 @@ Compilation unit elements:
(local "effectHandler__1")
pointer=(local "closurePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct (data-ptr)) (struct ())))))
- offset=(1 1 0)
+ element-offsets=(1 1 0)
)
(call _ "shed__runtime__effects_set_handler" ((local "effectHandler__1")))
(local-store (local "tmp__0") (int-const 0))
@@ -74,7 +74,7 @@ Instructions:
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct (data-ptr)) (struct ())))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(function-ptr-const "shed__effectHandlerMethod__f__0")
)
(call (local "effectHandlerCurrent__0") "shed__runtime__effects_get_handler" ())
@@ -82,7 +82,7 @@ Instructions:
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct (data-ptr)) (struct ())))))
- offset=(1 1 0)
+ element-offsets=(1 1 0)
value=(local "effectHandlerCurrent__0")
)
(data-ptr-to-int (local "closure__f__0") (local "closurePointer__f__0"))
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:immutableFreeVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:immutableFreeVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index e970ace9..5bac2752 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:immutableFreeVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:immutableFreeVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -30,14 +30,14 @@ Compilation unit elements:
(local "local__a")
pointer=(local "closurePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 0)
+ element-offsets=(1 2 0)
)
(
memory-load
(local "local__b")
pointer=(local "closurePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 1)
+ element-offsets=(1 2 1)
)
(call (local "gcRootStackIndex__0") "shed__runtime__gc_get_root_stack_index" ())
(call _ "shed__runtime__gc_set_root_stack_index" ((local "gcRootStackIndex__0")))
@@ -66,35 +66,35 @@ Instructions:
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 0)
+ element-offsets=(1 2 0)
value=(int-const 0)
)
(
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 1)
+ element-offsets=(1 2 1)
value=(int-const 0)
)
(
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(function-ptr-const "shed__function__f__0")
)
(
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 0)
+ element-offsets=(1 2 0)
value=(local "local__a")
)
(
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 1)
+ element-offsets=(1 2 1)
value=(local "local__b")
)
(data-ptr-to-int (local "closure__f__0") (local "closurePointer__f__0"))
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index f8b24821..43e193ad 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:pointersToFreeMutableVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -30,14 +30,14 @@ Compilation unit elements:
(local "local__a")
pointer=(local "closurePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (data-ptr data-ptr))))))
- offset=(1 2 0)
+ element-offsets=(1 2 0)
)
(
memory-load
(local "local__b")
pointer=(local "closurePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (data-ptr data-ptr))))))
- offset=(1 2 1)
+ element-offsets=(1 2 1)
)
(call (local "gcRootStackIndex__0") "shed__runtime__gc_get_root_stack_index" ())
(call _ "shed__runtime__gc_set_root_stack_index" ((local "gcRootStackIndex__0")))
@@ -66,35 +66,35 @@ Instructions:
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (data-ptr data-ptr))))))
- offset=(1 2 0)
+ element-offsets=(1 2 0)
value=(data-ptr-const null)
)
(
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (data-ptr data-ptr))))))
- offset=(1 2 1)
+ element-offsets=(1 2 1)
value=(data-ptr-const null)
)
(
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (data-ptr data-ptr))))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(function-ptr-const "shed__function__f__0")
)
(
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (data-ptr data-ptr))))))
- offset=(1 2 0)
+ element-offsets=(1 2 0)
value=(local "local__a")
)
(
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (data-ptr data-ptr))))))
- offset=(1 2 1)
+ element-offsets=(1 2 1)
value=(local "local__b")
)
(data-ptr-to-int (local "closure__f__0") (local "closurePointer__f__0"))
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:positionalAndNamedParamsAreDefined(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:positionalAndNamedParamsAreDefined(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index d3329bef..d58100c6 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:positionalAndNamedParamsAreDefined(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineFunctionTests]/[method:positionalAndNamedParamsAreDefined(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -36,14 +36,14 @@ Compilation unit elements:
(local "local__a")
pointer=(local "closurePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 0)
+ element-offsets=(1 2 0)
)
(
memory-load
(local "local__b")
pointer=(local "closurePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 1)
+ element-offsets=(1 2 1)
)
(call (local "gcRootStackIndex__0") "shed__runtime__gc_get_root_stack_index" ())
(call (local "binaryOpResult__0") "shed__runtime__int_add" ((local "local__a") (local "local__param1")))
@@ -74,35 +74,35 @@ Instructions:
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 0)
+ element-offsets=(1 2 0)
value=(int-const 0)
)
(
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 1)
+ element-offsets=(1 2 1)
value=(int-const 0)
)
(
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(function-ptr-const "shed__function__f__0")
)
(
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 0)
+ element-offsets=(1 2 0)
value=(local "local__a")
)
(
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct (int int))))))
- offset=(1 2 1)
+ element-offsets=(1 2 1)
value=(local "local__b")
)
(data-ptr-to-int (local "closure__f__0") (local "closurePointer__f__0"))
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructNonPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructNonPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 407e5776..aadd8bae 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructNonPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructNonPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -25,35 +25,35 @@ Compilation unit elements:
memory-store
pointer=(local "structValuePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(int-const 0)
)
(
memory-store
pointer=(local "structValuePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int))))
- offset=(1 1)
+ element-offsets=(1 1)
value=(int-const 0)
)
(
memory-store
pointer=(local "structValuePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int))))
- offset=(0 2)
+ element-offsets=(0 2)
value=(int-const 3)
)
(
memory-store
pointer=(local "structValuePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(local "local__name")
)
(
memory-store
pointer=(local "structValuePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int))))
- offset=(1 1)
+ element-offsets=(1 1)
value=(local "local__isActive")
)
(data-ptr-to-int (local "structValue__0") (local "structValuePointer__0"))
@@ -73,7 +73,7 @@ Instructions:
memory-store
pointer=(local "closurePointer__User__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct ())))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(function-ptr-const "shed__function__User__0")
)
(data-ptr-to-int (local "structType__User__0") (local "closurePointer__User__0"))
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 055a0733..66fb05e3 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioDefineStructTests]/[method:canGenerateCodeForDefineStructPositional(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -25,35 +25,35 @@ Compilation unit elements:
memory-store
pointer=(local "structValuePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(int-const 0)
)
(
memory-store
pointer=(local "structValuePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int))))
- offset=(1 1)
+ element-offsets=(1 1)
value=(int-const 0)
)
(
memory-store
pointer=(local "structValuePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int))))
- offset=(0 2)
+ element-offsets=(0 2)
value=(int-const 3)
)
(
memory-store
pointer=(local "structValuePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(local "local__name")
)
(
memory-store
pointer=(local "structValuePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int))))
- offset=(1 1)
+ element-offsets=(1 1)
value=(local "local__isActive")
)
(data-ptr-to-int (local "structValue__0") (local "structValuePointer__0"))
@@ -73,7 +73,7 @@ Instructions:
memory-store
pointer=(local "closurePointer__User__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct ())))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(function-ptr-const "shed__function__User__0")
)
(data-ptr-to-int (local "structType__User__0") (local "closurePointer__User__0"))
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioFieldLoadTests]/[method:canGenerateCodeForNamespaceFieldLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioFieldLoadTests]/[method:canGenerateCodeForNamespaceFieldLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index dcb1978e..c9979ab5 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioFieldLoadTests]/[method:canGenerateCodeForNamespaceFieldLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioFieldLoadTests]/[method:canGenerateCodeForNamespaceFieldLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -14,7 +14,7 @@ Instructions:
(local "tmp__y__0")
pointer=(local "namespacePointer__Example_Project__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int int))))
- offset=(1 1)
+ element-offsets=(1 1)
)
)
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioFieldLoadTests]/[method:canGenerateCodeForStructFieldLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioFieldLoadTests]/[method:canGenerateCodeForStructFieldLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 98b1b3c3..9a9181e5 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioFieldLoadTests]/[method:canGenerateCodeForStructFieldLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioFieldLoadTests]/[method:canGenerateCodeForStructFieldLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -14,7 +14,7 @@ Instructions:
(local "tmp__id__0")
pointer=(local "structValuePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int int))))
- offset=(1 1)
+ element-offsets=(1 1)
)
)
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioFieldLoadTests]/[method:canGenerateCodeForUserDefinedEffectFieldLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioFieldLoadTests]/[method:canGenerateCodeForUserDefinedEffectFieldLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index ab20a39e..fb9949f0 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioFieldLoadTests]/[method:canGenerateCodeForUserDefinedEffectFieldLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioFieldLoadTests]/[method:canGenerateCodeForUserDefinedEffectFieldLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -14,7 +14,7 @@ Instructions:
(local "tmp__fence__0")
pointer=(local "userDefinedEffectPointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int int))))
- offset=(1 1)
+ element-offsets=(1 1)
)
)
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioMethodLoadTests]/[method:canGenerateCodeForMethodLoadInDifferentNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioMethodLoadTests]/[method:canGenerateCodeForMethodLoadInDifferentNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 05f2af25..7c19c5c2 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioMethodLoadTests]/[method:canGenerateCodeForMethodLoadInDifferentNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioMethodLoadTests]/[method:canGenerateCodeForMethodLoadInDifferentNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -13,7 +13,7 @@ Instructions:
(local "tmp__name__0")
pointer=(data-ptr-const "shed__method__Example_Project__User__name")
layout=int
- offset=()
+ element-offsets=()
)
)
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioMethodLoadTests]/[method:canGenerateCodeForMethodLoadInSameNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioMethodLoadTests]/[method:canGenerateCodeForMethodLoadInSameNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 7b048f63..383ce5d1 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioMethodLoadTests]/[method:canGenerateCodeForMethodLoadInSameNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioMethodLoadTests]/[method:canGenerateCodeForMethodLoadInSameNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -12,7 +12,7 @@ Instructions:
(local "tmp__name__0")
pointer=(data-ptr-const "shed__method__Example_Project__User__name")
layout=int
- offset=()
+ element-offsets=()
)
)
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioMethodStoreTests]/[method:canGenerateCodeForMethodStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioMethodStoreTests]/[method:canGenerateCodeForMethodStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 8979075b..90f91926 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioMethodStoreTests]/[method:canGenerateCodeForMethodStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioMethodStoreTests]/[method:canGenerateCodeForMethodStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -11,7 +11,7 @@ Instructions:
memory-store
pointer=(data-ptr-const "shed__method__Example_Project__User__name")
layout=int
- offset=()
+ element-offsets=()
value=(local "b")
)
)
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioNamespaceFieldStoreTests]/[method:canGenerateCodeForNamespaceFieldStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioNamespaceFieldStoreTests]/[method:canGenerateCodeForNamespaceFieldStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 1591a560..c131e63e 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioNamespaceFieldStoreTests]/[method:canGenerateCodeForNamespaceFieldStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioNamespaceFieldStoreTests]/[method:canGenerateCodeForNamespaceFieldStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -12,13 +12,13 @@ Instructions:
(local "namespaceValue__0")
pointer=(data-ptr-const "shed__namespace__Example_Project")
layout=data-ptr
- offset=()
+ element-offsets=()
)
(
memory-store
pointer=(local "namespaceValue__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int int))))
- offset=(1 1)
+ element-offsets=(1 1)
value=(local "b")
)
)
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioNamespaceTests]/[method:canDefineNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioNamespaceTests]/[method:canDefineNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 2f6aa036..76460b4b 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioNamespaceTests]/[method:canDefineNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioNamespaceTests]/[method:canDefineNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -51,21 +51,21 @@
memory-store
pointer=(local "namespaceValue__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(int-const 0)
)
(
memory-store
pointer=(local "namespaceValue__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int))))
- offset=(1 1)
+ element-offsets=(1 1)
value=(int-const 0)
)
(
memory-store
pointer=(data-ptr-const "shed__namespace__An_Example")
layout=data-ptr
- offset=()
+ element-offsets=()
value=(local "namespaceValue__0")
)
(call (local "closurePointer__f__0") "shed__runtime__gc_alloc" ((int-const (byte-size-of (struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct ()))))))) (int32-const 4)))
@@ -73,7 +73,7 @@
memory-store
pointer=(local "closurePointer__f__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (function-ptr (struct ()) (struct ())))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(function-ptr-const "shed__function__f__0")
)
(data-ptr-to-int (local "closure__f__0") (local "closurePointer__f__0"))
@@ -81,7 +81,7 @@
memory-store
pointer=(data-ptr-const "shed__namespaceIsInited__An_Example")
layout=bool
- offset=()
+ element-offsets=()
value=(bool-const true)
)
(return-void)
@@ -99,7 +99,7 @@
(local "tmp__0")
pointer=(data-ptr-const "shed__namespaceIsInited__An_Example")
layout=bool
- offset=()
+ element-offsets=()
)
(
if
@@ -124,7 +124,7 @@
(local "namespacePointer__0")
pointer=(data-ptr-const "shed__namespace__An_Example")
layout=data-ptr
- offset=()
+ element-offsets=()
)
(data-ptr-to-int (local "namespaceValue__0") (local "namespacePointer__0"))
(return (local "namespaceValue__0"))
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioSwitchTests]/[method:canGenerateCodeForSwitchWithSingleResult(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioSwitchTests]/[method:canGenerateCodeForSwitchWithSingleResult(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index bb3f18e3..d7367a3f 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioSwitchTests]/[method:canGenerateCodeForSwitchWithSingleResult(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioSwitchTests]/[method:canGenerateCodeForSwitchWithSingleResult(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -33,7 +33,7 @@ Instructions:
(local "switchTag__0")
pointer=(local "structValuePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct ())))
- offset=(0 2)
+ element-offsets=(0 2)
)
(
switch
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTryTests]/[method:canGenerateCodeForTry(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTryTests]/[method:canGenerateCodeForTry(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index c581add5..c14f9340 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTryTests]/[method:canGenerateCodeForTry(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTryTests]/[method:canGenerateCodeForTry(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -39,21 +39,21 @@ Instructions:
memory-store
pointer=(local "effectHandler__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (data-ptr (struct (int int int))))))
- offset=(1 1 0)
+ element-offsets=(1 1 0)
value=(int-const 0)
)
(
memory-store
pointer=(local "effectHandler__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (data-ptr (struct (int int int))))))
- offset=(1 1 1)
+ element-offsets=(1 1 1)
value=(int-const 0)
)
(
memory-store
pointer=(local "effectHandler__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (data-ptr (struct (int int int))))))
- offset=(1 1 2)
+ element-offsets=(1 1 2)
value=(int-const 0)
)
(call _ "shed__runtime__effects_push_handler" ((local "effectHandler__0")))
@@ -61,21 +61,21 @@ Instructions:
memory-store
pointer=(local "effectHandler__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (data-ptr (struct (int int int))))))
- offset=(1 1 0)
+ element-offsets=(1 1 0)
value=(local "handlerC")
)
(
memory-store
pointer=(local "effectHandler__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (data-ptr (struct (int int int))))))
- offset=(1 1 1)
+ element-offsets=(1 1 1)
value=(local "handlerA")
)
(
memory-store
pointer=(local "effectHandler__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (data-ptr (struct (int int int))))))
- offset=(1 1 2)
+ element-offsets=(1 1 2)
value=(local "handlerB")
)
(
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTryTests]/[method:effectHandlerIsPoppedBeforeReturn(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTryTests]/[method:effectHandlerIsPoppedBeforeReturn(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 20d6c786..8cb8b8bc 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTryTests]/[method:effectHandlerIsPoppedBeforeReturn(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTryTests]/[method:effectHandlerIsPoppedBeforeReturn(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -51,7 +51,7 @@ Instructions:
memory-store
pointer=(local "effectHandler__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (data-ptr (struct (int))))))
- offset=(1 1 0)
+ element-offsets=(1 1 0)
value=(int-const 0)
)
(call _ "shed__runtime__effects_push_handler" ((local "effectHandler__0")))
@@ -59,7 +59,7 @@ Instructions:
memory-store
pointer=(local "effectHandler__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (data-ptr (struct (int))))))
- offset=(1 1 0)
+ element-offsets=(1 1 0)
value=(local "handlerA")
)
(
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTupleCreateTests]/[method:canGenerateCodeForTupleCreate(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTupleCreateTests]/[method:canGenerateCodeForTupleCreate(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 4c146e20..9ac22878 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTupleCreateTests]/[method:canGenerateCodeForTupleCreate(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTupleCreateTests]/[method:canGenerateCodeForTupleCreate(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -25,42 +25,42 @@ Instructions:
memory-store
pointer=(local "tuplePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int int))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(int-const 0)
)
(
memory-store
pointer=(local "tuplePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int int))))
- offset=(1 1)
+ element-offsets=(1 1)
value=(int-const 0)
)
(
memory-store
pointer=(local "tuplePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int int))))
- offset=(1 2)
+ element-offsets=(1 2)
value=(int-const 0)
)
(
memory-store
pointer=(local "tuplePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int int))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(local "tupleElement__0__0")
)
(
memory-store
pointer=(local "tuplePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int int))))
- offset=(1 1)
+ element-offsets=(1 1)
value=(local "tupleElement__1__0")
)
(
memory-store
pointer=(local "tuplePointer__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int int))))
- offset=(1 2)
+ element-offsets=(1 2)
value=(local "tupleElement__2__0")
)
(data-ptr-to-int (local "tuple__0") (local "tuplePointer__0"))
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTupleGetTests]/[method:canGenerateCodeForTupleGet(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTupleGetTests]/[method:canGenerateCodeForTupleGet(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 327fa5c9..0e598c0a 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTupleGetTests]/[method:canGenerateCodeForTupleGet(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioTupleGetTests]/[method:canGenerateCodeForTupleGet(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -14,7 +14,7 @@ Instructions:
(local "tupleElement__2__0")
pointer=(local "tuple__0")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int int int))))
- offset=(1 2)
+ element-offsets=(1 2)
)
)
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioVarLoadTests]/[method:canGenerateCodeForVarLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioVarLoadTests]/[method:canGenerateCodeForVarLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index d67e3495..49ffbfe6 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioVarLoadTests]/[method:canGenerateCodeForVarLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioVarLoadTests]/[method:canGenerateCodeForVarLoad(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -13,7 +13,7 @@ Instructions:
(local "varValue__x__0")
pointer=(local "local__x")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int))))
- offset=(1 0)
+ element-offsets=(1 0)
)
)
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioVarStoreTests]/[method:canGenerateCodeForVarStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioVarStoreTests]/[method:canGenerateCodeForVarStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 05abe433..7cb87ab3 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioVarStoreTests]/[method:canGenerateCodeForVarStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioVarStoreTests]/[method:canGenerateCodeForVarStore(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -11,7 +11,7 @@ Instructions:
memory-store
pointer=(local "local__x")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(local "b")
)
)
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioVarStoreTests]/[method:canStoreIntoVarMultipleTimes(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioVarStoreTests]/[method:canStoreIntoVarMultipleTimes(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index e7392072..da0dfa13 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioVarStoreTests]/[method:canStoreIntoVarMultipleTimes(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.shidtopatio.ShidToPatioVarStoreTests]/[method:canStoreIntoVarMultipleTimes(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -11,14 +11,14 @@ Instructions:
memory-store
pointer=(local "local__x")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(local "b")
)
(
memory-store
pointer=(local "local__x")
layout=(struct ((struct (data-ptr int32 int32)) (struct (int))))
- offset=(1 0)
+ element-offsets=(1 0)
value=(local "a")
)
)
diff --git a/src/main/java/org/shedlang/compiler/backends/llvm/codegen/PatioToLlvm.java b/src/main/java/org/shedlang/compiler/backends/llvm/codegen/PatioToLlvm.java
index a93b9337..5f554710 100644
--- a/src/main/java/org/shedlang/compiler/backends/llvm/codegen/PatioToLlvm.java
+++ b/src/main/java/org/shedlang/compiler/backends/llvm/codegen/PatioToLlvm.java
@@ -572,14 +572,14 @@ public class PatioToLlvm {
context.target()
)),
patioOperandToLlvmOperand(patioMemoryLoad.pointer(), context),
- patioDataOffsetsToLlvmOffsets(patioMemoryLoad.layout(), patioMemoryLoad.offset())
+ patioDataElementOffsetsToLlvmOffsets(patioMemoryLoad.layout(), patioMemoryLoad.elementOffsets())
));
context = context.addInstruction(new LlvmLoad(
destination,
patioDataOffsetToLlvmType(
patioMemoryLoad.layout(),
- patioMemoryLoad.offset(),
+ patioMemoryLoad.elementOffsets(),
context.target()
),
pointer
@@ -600,13 +600,13 @@ public class PatioToLlvm {
context.target()
)),
patioOperandToLlvmOperand(patioMemoryStore.pointer(), context),
- patioDataOffsetsToLlvmOffsets(patioMemoryStore.layout(), patioMemoryStore.offset())
+ patioDataElementOffsetsToLlvmOffsets(patioMemoryStore.layout(), patioMemoryStore.elementOffsets())
));
context = context.addInstruction(new LlvmStore(
patioDataOffsetToLlvmType(
patioMemoryStore.layout(),
- patioMemoryStore.offset(),
+ patioMemoryStore.elementOffsets(),
context.target()
),
patioOperandToLlvmOperand(patioMemoryStore.value(), context),
@@ -985,32 +985,32 @@ public class PatioToLlvm {
return context;
}
- private static PVector<LlvmTypedOperand> patioDataOffsetsToLlvmOffsets(
+ private static PVector<LlvmTypedOperand> patioDataElementOffsetsToLlvmOffsets(
PatioDataLayout patioDataLayout,
- List<Integer> patioOffsets
+ List<Integer> patioElementOffsets
) {
- return patioDataOffsetsToLlvmOffsets(
+ return patioDataElementOffsetsToLlvmOffsets(
patioDataLayout,
- TreePVector.from(patioOffsets),
+ TreePVector.from(patioElementOffsets),
P.vector()
).plus(0, LlvmTypedOperand.arrayIndex(0));
}
- private static PVector<LlvmTypedOperand> patioDataOffsetsToLlvmOffsets(
+ private static PVector<LlvmTypedOperand> patioDataElementOffsetsToLlvmOffsets(
PatioDataLayout patioDataLayout,
- PVector<Integer> patioOffsets,
+ PVector<Integer> patioElementOffsets,
PVector<LlvmTypedOperand> llvmOffsets
) {
- if (patioOffsets.isEmpty()) {
+ if (patioElementOffsets.isEmpty()) {
return llvmOffsets;
} else {
- var patioOffset = patioOffsets.get(0);
+ var patioOffset = patioElementOffsets.get(0);
return switch (patioDataLayout) {
case PatioDataLayoutArray patioDataLayoutArray ->
- patioDataOffsetsToLlvmOffsets(
+ patioDataElementOffsetsToLlvmOffsets(
patioDataLayoutArray.element(),
- patioOffsets.minus(0),
+ patioElementOffsets.minus(0),
llvmOffsets.plus(LlvmTypedOperand.arrayIndex(patioOffset))
);
@@ -1033,9 +1033,9 @@ public class PatioToLlvm {
throw new RuntimeException("offset not allowed for int32s");
case PatioDataLayoutStruct patioDataLayoutStruct ->
- patioDataOffsetsToLlvmOffsets(
+ patioDataElementOffsetsToLlvmOffsets(
patioDataLayoutStruct.elements().get(patioOffset),
- patioOffsets.minus(0),
+ patioElementOffsets.minus(0),
llvmOffsets.plus(LlvmTypedOperand.structureIndex(patioOffset))
);
};
@@ -1145,7 +1145,7 @@ public class PatioToLlvm {
case PatioIntValueByteOffsetOf byteOffsetOf ->
offsetOf(
byteOffsetOf.layout(),
- byteOffsetOf.offset(),
+ byteOffsetOf.elementOffsets(),
patioDestinationType,
target
);
@@ -1376,7 +1376,7 @@ public class PatioToLlvm {
target
)),
new LlvmOperandNull(),
- patioDataOffsetsToLlvmOffsets(patioDataLayout, patioOffset)
+ patioDataElementOffsetsToLlvmOffsets(patioDataLayout, patioOffset)
);
return new LlvmOperandPtrToInt(
offsetPtr,
diff --git a/src/main/java/org/shedlang/compiler/backends/wasm/PatioToWasm.java b/src/main/java/org/shedlang/compiler/backends/wasm/PatioToWasm.java
index c9f47659..356b016f 100644
--- a/src/main/java/org/shedlang/compiler/backends/wasm/PatioToWasm.java
+++ b/src/main/java/org/shedlang/compiler/backends/wasm/PatioToWasm.java
@@ -313,7 +313,7 @@ public class PatioToWasm {
context.wasmLocalType(patioMemoryLoad.destination()),
wasmMemoryArg(
patioMemoryLoad.layout(),
- patioMemoryLoad.offset(),
+ patioMemoryLoad.elementOffsets(),
target
)
));
@@ -332,7 +332,7 @@ public class PatioToWasm {
patioOperandToWasmValueType(patioMemoryStore.value(), context),
wasmMemoryArg(
patioMemoryStore.layout(),
- patioMemoryStore.offset(),
+ patioMemoryStore.elementOffsets(),
target
)
));
@@ -588,7 +588,7 @@ public class PatioToWasm {
case PatioIntValueByteOffsetOf byteOffsetOf ->
offsetOf(
byteOffsetOf.layout(),
- byteOffsetOf.offset(),
+ byteOffsetOf.elementOffsets(),
target
);
diff --git a/src/main/java/org/shedlang/compiler/patio/PatioSerializer.java b/src/main/java/org/shedlang/compiler/patio/PatioSerializer.java
index 412dd932..d9ca8c37 100644
--- a/src/main/java/org/shedlang/compiler/patio/PatioSerializer.java
+++ b/src/main/java/org/shedlang/compiler/patio/PatioSerializer.java
@@ -281,7 +281,7 @@ public class PatioSerializer {
operandToTree(memoryLoad.destination()),
treeNamed("pointer", operandToTree(memoryLoad.pointer())),
treeNamed("layout", dataLayoutToTree(memoryLoad.layout())),
- treeNamed("offset", offsetToTree(memoryLoad.offset()))
+ treeNamed("element-offsets", elementOffsetsToTree(memoryLoad.elementOffsets()))
);
case PatioMemoryStore memoryStore ->
@@ -289,7 +289,7 @@ public class PatioSerializer {
treeIdentifier("memory-store"),
treeNamed("pointer", operandToTree(memoryStore.pointer())),
treeNamed("layout", dataLayoutToTree(memoryStore.layout())),
- treeNamed("offset", offsetToTree(memoryStore.offset())),
+ treeNamed("element-offsets", elementOffsetsToTree(memoryStore.elementOffsets())),
treeNamed("value", operandToTree(memoryStore.value()))
);
@@ -580,7 +580,7 @@ public class PatioSerializer {
treeList(
treeIdentifier("byte-offset-of"),
dataLayoutToTree(byteOffsetOf.layout()),
- offsetToTree(byteOffsetOf.offset())
+ elementOffsetsToTree(byteOffsetOf.elementOffsets())
);
case PatioIntValueByteSizeOf byteSizeOf ->
@@ -594,9 +594,9 @@ public class PatioSerializer {
};
}
- private static Tree offsetToTree(List<Integer> memoryLoad) {
+ private static Tree elementOffsetsToTree(List<Integer> elementOffsets) {
return treeList(
- memoryLoad.stream()
+ elementOffsets.stream()
.map(offset -> treeInt(offset))
.toList()
);
diff --git a/src/main/java/org/shedlang/compiler/patio/instructions/PatioMemoryLoad.java b/src/main/java/org/shedlang/compiler/patio/instructions/PatioMemoryLoad.java
index 2251ae91..1262d040 100644
--- a/src/main/java/org/shedlang/compiler/patio/instructions/PatioMemoryLoad.java
+++ b/src/main/java/org/shedlang/compiler/patio/instructions/PatioMemoryLoad.java
@@ -15,7 +15,7 @@ public record PatioMemoryLoad(
PatioLocalRef destination,
PatioOperand pointer,
PatioDataLayout layout,
- List<Integer> offset,
+ List<Integer> elementOffsets,
Source source
) implements PatioInstruction {
@Override
diff --git a/src/main/java/org/shedlang/compiler/patio/instructions/PatioMemoryStore.java b/src/main/java/org/shedlang/compiler/patio/instructions/PatioMemoryStore.java
index ccc5c36a..cfcdf9a7 100644
--- a/src/main/java/org/shedlang/compiler/patio/instructions/PatioMemoryStore.java
+++ b/src/main/java/org/shedlang/compiler/patio/instructions/PatioMemoryStore.java
@@ -12,7 +12,7 @@ import java.util.List;
public record PatioMemoryStore(
PatioOperand pointer,
PatioDataLayout layout,
- List<Integer> offset,
+ List<Integer> elementOffsets,
PatioOperand value,
Source source
) implements PatioInstruction {
diff --git a/src/main/java/org/shedlang/compiler/patio/serialization/PatioToFlatbuffers.java b/src/main/java/org/shedlang/compiler/patio/serialization/PatioToFlatbuffers.java
index cc631f36..20c5f9f9 100644
--- a/src/main/java/org/shedlang/compiler/patio/serialization/PatioToFlatbuffers.java
+++ b/src/main/java/org/shedlang/compiler/patio/serialization/PatioToFlatbuffers.java
@@ -1561,9 +1561,9 @@ public class PatioToFlatbuffers {
var destinationFbs = serializeLocalRef(builder, instruction.destination());
var pointerFbs = serializeOperand(builder, instruction.pointer());
var layoutFbs = serializeDataLayout(builder, instruction.layout());
- var offsetFbs = PatioMemoryLoadFbs.createOffsetVector(
+ var elementOffsetsFb = PatioMemoryLoadFbs.createElementOffsetsVector(
builder,
- serializeListOfInts(instruction.offset())
+ serializeListOfInts(instruction.elementOffsets())
);
PatioMemoryLoadFbs.startPatioMemoryLoadFbs(builder);
@@ -1571,7 +1571,7 @@ public class PatioToFlatbuffers {
PatioMemoryLoadFbs.addDestination(builder, destinationFbs);
PatioMemoryLoadFbs.addPointer(builder, pointerFbs);
PatioMemoryLoadFbs.addLayout(builder, layoutFbs);
- PatioMemoryLoadFbs.addOffset(builder, offsetFbs);
+ PatioMemoryLoadFbs.addElementOffsets(builder, elementOffsetsFb);
return PatioMemoryLoadFbs.endPatioMemoryLoadFbs(builder);
}
@@ -1584,9 +1584,9 @@ public class PatioToFlatbuffers {
var destination = deserializeLocalRef(instructionFbs.destination());
var pointer = deserializeOperand(instructionFbs.pointer());
var layout = deserializeDataLayout(instructionFbs.layout());
- var offset = deserializeListOfInts(instructionFbs.offsetVector());
+ var elementOffsets = deserializeListOfInts(instructionFbs.elementOffsetsVector());
- return new PatioMemoryLoad(destination, pointer, layout, offset, source);
+ return new PatioMemoryLoad(destination, pointer, layout, elementOffsets, source);
}
public static int serializeMemoryStore(
@@ -1602,9 +1602,9 @@ public class PatioToFlatbuffers {
var pointerFbs = serializeOperand(builder, instruction.pointer());
var layoutFbs = serializeDataLayout(builder, instruction.layout());
- var offsetFbs = PatioMemoryStoreFbs.createOffsetVector(
+ var elementOffsetsFbs = PatioMemoryStoreFbs.createElementOffsetsVector(
builder,
- serializeListOfInts(instruction.offset())
+ serializeListOfInts(instruction.elementOffsets())
);
var valueFbs = serializeOperand(builder, instruction.value());
@@ -1612,7 +1612,7 @@ public class PatioToFlatbuffers {
PatioMemoryStoreFbs.addSource(builder, sourceFbs);
PatioMemoryStoreFbs.addPointer(builder, pointerFbs);
PatioMemoryStoreFbs.addLayout(builder, layoutFbs);
- PatioMemoryStoreFbs.addOffset(builder, offsetFbs);
+ PatioMemoryStoreFbs.addElementOffsets(builder, elementOffsetsFbs);
PatioMemoryStoreFbs.addValue(builder, valueFbs);
return PatioMemoryStoreFbs.endPatioMemoryStoreFbs(builder);
}
@@ -1625,10 +1625,10 @@ public class PatioToFlatbuffers {
var pointer = deserializeOperand(instructionFbs.pointer());
var layout = deserializeDataLayout(instructionFbs.layout());
- var offset = deserializeListOfInts(instructionFbs.offsetVector());
+ var elementOffsets = deserializeListOfInts(instructionFbs.elementOffsetsVector());
var value = deserializeOperand(instructionFbs.value());
- return new PatioMemoryStore(pointer, layout, offset, value, source);
+ return new PatioMemoryStore(pointer, layout, elementOffsets, value, source);
}
public static int serializeResume(
@@ -2267,15 +2267,15 @@ public class PatioToFlatbuffers {
return switch (value) {
case PatioIntValueByteOffsetOf byteOffsetOf -> {
var layoutFbs = serializeDataLayout(builder, byteOffsetOf.layout());
- var offsetFbs = PatioIntValueByteOffsetOfFbs.createOffsetVector(
+ var elementOffsetsFbs = PatioIntValueByteOffsetOfFbs.createElementOffsetsVector(
builder,
- serializeListOfInts(byteOffsetOf.offset())
+ serializeListOfInts(byteOffsetOf.elementOffsets())
);
var byteOffsetOfFbs = PatioIntValueByteOffsetOfFbs.createPatioIntValueByteOffsetOfFbs(
builder,
layoutFbs,
- offsetFbs
+ elementOffsetsFbs
);
PatioIntValueFbs.startPatioIntValueFbs(builder);
@@ -2311,8 +2311,8 @@ public class PatioToFlatbuffers {
case PatioIntValueValueFbs.PatioIntValueByteOffsetOfFbs -> {
var byteOffsetOfFbs = (PatioIntValueByteOffsetOfFbs) valueFbs.value(new PatioIntValueByteOffsetOfFbs());
var layout = deserializeDataLayout(byteOffsetOfFbs.layout());
- var offset = deserializeListOfInts(byteOffsetOfFbs.offsetVector());
- yield new PatioIntValueByteOffsetOf(layout, offset);
+ var elementOffsets = deserializeListOfInts(byteOffsetOfFbs.elementOffsetsVector());
+ yield new PatioIntValueByteOffsetOf(layout, elementOffsets);
}
case PatioIntValueValueFbs.PatioIntValueByteSizeOfFbs -> {
diff --git a/src/main/java/org/shedlang/compiler/patio/values/PatioIntValueByteOffsetOf.java b/src/main/java/org/shedlang/compiler/patio/values/PatioIntValueByteOffsetOf.java
index 90aef911..24219048 100644
--- a/src/main/java/org/shedlang/compiler/patio/values/PatioIntValueByteOffsetOf.java
+++ b/src/main/java/org/shedlang/compiler/patio/values/PatioIntValueByteOffsetOf.java
@@ -9,6 +9,6 @@ import java.util.List;
*/
public record PatioIntValueByteOffsetOf(
PatioDataLayout layout,
- List<Integer> offset
+ List<Integer> elementOffsets
) implements PatioIntValue {
}
diff --git a/src/test/java/org/shedlang/compiler/patio/PatioSerializerTests.java b/src/test/java/org/shedlang/compiler/patio/PatioSerializerTests.java
index 448da19c..525091ba 100644
--- a/src/test/java/org/shedlang/compiler/patio/PatioSerializerTests.java
+++ b/src/test/java/org/shedlang/compiler/patio/PatioSerializerTests.java
@@ -446,7 +446,7 @@ public class PatioSerializerTests {
(local "destination")
pointer=(local "pointer")
layout=(struct (int int byte))
- offset=(1)
+ element-offsets=(1)
)"""
));
}
@@ -467,7 +467,7 @@ public class PatioSerializerTests {
memory-store
pointer=(local "pointer")
layout=(struct (int int byte))
- offset=(1)
+ element-offsets=(1)
value=(local "value")
)"""
));