initial thoughts on IR for C c-compilation
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Sun, 25 Apr 2021 04:11:48 +0000 (23:11 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Sun, 25 Apr 2021 04:11:48 +0000 (23:11 -0500)
docs/c_ir [new file with mode: 0644]

diff --git a/docs/c_ir b/docs/c_ir
new file mode 100644 (file)
index 0000000..54ff203
--- /dev/null
+++ b/docs/c_ir
@@ -0,0 +1,16 @@
+A basic IR is going to be needed for the C compilation of Onyx. I've never done
+this before so the following are just some thoughts that have no proof of working.
+
+The IR instructions will be based on a 3 address code with an unlimited number
+of temporaries that will (probably) be allocated in a SSA form.
+
+Some of the IR instructions I think will be necessary:
+
+    - Immediate Load for different types
+    - Binary Operator 3 address code
+    - Unary Operator 2 address code
+    - Memory store for different types
+    - Memory load for different types
+    - Call
+    - Foreign Call
+