From: Brendan Hansen Date: Sun, 25 Apr 2021 04:11:48 +0000 (-0500) Subject: initial thoughts on IR for C X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=refs%2Fheads%2Fc-compilation;p=onyx.git initial thoughts on IR for C --- 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 +