Routines to optimize generated code.
More...
#include <CodeGenerator.h>
Routines to optimize generated code.
A collection of routines for generating LLVM IR from a program AST and its semantic analysis results and for emitting the resulting LLVM IR to a file.
◆ emit()
CodeGenerator::emit |
( |
llvm::Module * |
m, |
|
|
std::string |
filename = "" |
|
) |
| |
|
static |
Emit LLVM IR to a file.
- Parameters
-
m | the LLVM module holding the generated program |
◆ emitHumanReadableAssembly()
CodeGenerator::emitHumanReadableAssembly |
( |
llvm::Module * |
m, |
|
|
std::string |
filename = "" |
|
) |
| |
|
static |
Emit LLVM human-readable assembly to a file.
- Parameters
-
m | the LLVM module holding the generated program |
◆ generate()
Generate LLVM IR for ast.
Apply a series of basic optimization passes to the given LLVM module.
- Parameters
-
program | the root of an AST encoding the program |
analysisResults | the results from semantic analysis of the program |
fileName | the name of the source file holding the program |
- Returns
- the LLVM module holding the generated program
The documentation for this class was generated from the following files: