aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/shedlang/compiler/backends
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-11-22 22:58:23 +0000
committerMichael Williamson <mike@zwobble.org>2023-11-22 22:58:23 +0000
commita8e9e00313a07442d05523ea4c189ac61d77a34f (patch)
treeda154647e80c335ee8b8f40e6b623fa49d517bcf /src/main/java/org/shedlang/compiler/backends
parent5bd9f3a11c73ee9c4196985a05f68f4d69ff9432 (diff)
Add throw and try instructions to Patio
Diffstat (limited to 'src/main/java/org/shedlang/compiler/backends')
-rw-r--r--src/main/java/org/shedlang/compiler/backends/llvm/LlvmPatioCodeGen.java8
-rw-r--r--src/main/java/org/shedlang/compiler/backends/wasm/WasmPatioCodeGen.java6
2 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/org/shedlang/compiler/backends/llvm/LlvmPatioCodeGen.java b/src/main/java/org/shedlang/compiler/backends/llvm/LlvmPatioCodeGen.java
index 114922e4..651f7aff 100644
--- a/src/main/java/org/shedlang/compiler/backends/llvm/LlvmPatioCodeGen.java
+++ b/src/main/java/org/shedlang/compiler/backends/llvm/LlvmPatioCodeGen.java
@@ -72,7 +72,7 @@ public class LlvmPatioCodeGen {
case PatioDataElementMutable patioDataElementMutable ->
generateDataElementMutable(patioDataElementMutable, context);
-
+
case PatioExceptionTypeDefinition patioExceptionTypeDefinition ->
throw new UnsupportedOperationException("TODO");
@@ -566,6 +566,12 @@ public class LlvmPatioCodeGen {
yield context;
}
+ case PatioThrow throw_ ->
+ throw new UnsupportedOperationException("TODO");
+
+ case PatioTry try_ ->
+ throw new UnsupportedOperationException("TODO");
+
case PatioUnreachable patioUnreachable ->
context.addTerminatorInstruction(new LlvmUnreachable());
diff --git a/src/main/java/org/shedlang/compiler/backends/wasm/WasmPatioCodeGen.java b/src/main/java/org/shedlang/compiler/backends/wasm/WasmPatioCodeGen.java
index 3436ef1b..8beac54d 100644
--- a/src/main/java/org/shedlang/compiler/backends/wasm/WasmPatioCodeGen.java
+++ b/src/main/java/org/shedlang/compiler/backends/wasm/WasmPatioCodeGen.java
@@ -337,6 +337,12 @@ public class WasmPatioCodeGen {
yield context;
}
+ case PatioThrow throw_ ->
+ throw new UnsupportedOperationException("TODO");
+
+ case PatioTry try_ ->
+ throw new UnsupportedOperationException("TODO");
+
case PatioUnreachable patioUnreachable ->
context.addInstruction(new WasmUnreachable());