![]() |
Purple
0.1
Standard Language Specification
|
Functions for LLVM-IR translation. More...

Functions | |
| static void | translate_init (void) |
| Initialize any values required for LLVM translation. More... | |
| LLVMStackEntryNode * | determine_binary_expression_stack_allocation (ASTNode *root) |
| Perform a DFS on an AST to determine the stack allocation needed for a binary expression. More... | |
| static LLVMValue | if_ast_to_llvm (ASTNode *n) |
| Generate LLVM-IR for an if statement AST. More... | |
| static LLVMValue | while_else_ast_to_llvm (ASTNode *n) |
| Generate LLVM-IR for a while-else statement AST. More... | |
| static LLVMValue | print_ast_to_llvm (ASTNode *root, LLVMValue virtual_register) |
| Generate LLVM-IR for a print statement. More... | |
| LLVMValue | ast_to_llvm (ASTNode *root, LLVMValue llvm_value, TokenType parent_operation) |
| Generates LLVM-IR from a given AST. More... | |
| void | generate_llvm (void) |
| Wrapper function for generating LLVM. More... | |
Variables | |
| LLVMStackEntryNode * | freeVirtualRegistersHead = NULL |
| Head node of linked list containing register indices that are free to have values stored in them. More... | |
Functions for LLVM-IR translation.
| LLVMStackEntryNode * determine_binary_expression_stack_allocation | ( | ASTNode * | root | ) |
Perform a DFS on an AST to determine the stack allocation needed for a binary expression.
| root | Root of AST to find stack allocation for |
| void generate_llvm | ( | void | ) |
Wrapper function for generating LLVM.
Generate LLVM-IR for an if statement AST.
jump false_label if !condition body() jump end_label false_label: falsebody() end_label:
| n | Root AST node |
|
static |
Initialize any values required for LLVM translation.
Generate LLVM-IR for a while-else statement AST.
condition_label: jump else_label if !condition body() jump condition_label else_label: elsebody()
| n | Root AST node |
| LLVMStackEntryNode* freeVirtualRegistersHead = NULL |
Head node of linked list containing register indices that are free to have values stored in them.