first try of registry allocation

This commit is contained in:
2025-12-23 15:30:03 +01:00
parent ce900632d3
commit e5d912b28e
13 changed files with 461 additions and 350 deletions

View File

@@ -1,11 +1,11 @@
#include <iostream>
#include <fstream>
#include <print>
#include "lexer.hpp"
#include "ast.hpp"
#include "ir.hpp"
#include "parser/lexer.hpp"
#include "parser/ast.hpp"
#include "ir/ir.hpp"
#include "codegens/fasm_stack.hpp"
#include "codegen/fasm_stack.hpp"
void dump_tokens(const char* filename, Lexer* lexer)
{
@@ -50,16 +50,16 @@ int main(int argc, char** argv)
auto ops = irBuilder.Build();
// printf("; ------ IR ------\n");
// for (size_t i = 0; i < ops.size; ++i)
// {
// printf("; %s\n", ops.data[i]->Format(0).c_str());
// }
// printf("; ------ IR ------\n");
for (size_t i = 0; i < ops.size; ++i)
{
printf("%s\n", ops.data[i]->Format(0).c_str());
}
StackFasmX86_64Generator gen;
// StackFasmX86_64Generator gen;
gen.Generate(filename, ops);
// gen.Generate(filename, ops);
// printf("%s\n", gen.GetOutput().c_str());
return 0;
}