Skip to content

Commit

Permalink
report: Add control flow
Browse files Browse the repository at this point in the history
  • Loading branch information
sangisos committed Aug 31, 2016
1 parent 8bf84a0 commit 7e8d6b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion report/sections/6_ir_generation.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ \section{IR Generation}

\input{sections/6_ir_generation/1_installation_and_usage}
\input{sections/6_ir_generation/2_design_decisions}
%\input{sections/6_ir_generation/3_implementation}
\input{sections/6_ir_generation/3_implementation}
\input{sections/6_ir_generation/4_validation}
8 changes: 6 additions & 2 deletions report/sections/6_ir_generation/3_implementation.tex
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
% Skipping this section fow now.

%\subsection{Implementation}
\subsection{Implementation}

%\subsubsection{Control Flow}
\subsubsection{Control Flow}
%TODO: alex

When walking the ast for code generation, if an if-statement is encountered, two new basic blocks are created, one for the true branch and one end basic block to join the true and false branches. The false branch is set to the end basic block. If an else statement is present, a third new basic block is created and the false branch instead set to this new basic block. Both new branch basic blocks have their terminating instruction set to jump to the end basic block.

Analogously for while and return statements.

%\subsubsection{Implicit Conversion}
%TODO: alex

0 comments on commit 7e8d6b2

Please sign in to comment.