From 5105cb2b52a2ac5eaba3fb2ddb00889cb155fcce Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Sat, 24 Apr 2021 23:11:48 -0500 Subject: [PATCH] initial thoughts on IR for C --- docs/c_ir | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 docs/c_ir diff --git a/docs/c_ir b/docs/c_ir new file mode 100644 index 00000000..54ff2032 --- /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 + -- 2.25.1