[backend-llir]修复了许多重构的bug

This commit is contained in:
Lixuanwang
2025-07-19 17:50:14 +08:00
parent d4a6996d74
commit 9528335a04
11 changed files with 513 additions and 497 deletions

View File

@@ -1,10 +1,8 @@
#ifndef RISCV64_BACKEND_H
#define RISCV64_BACKEND_H
#include "IR.h" // 只需包含高层IR定义
#include "IR.h"
#include <string>
#include <vector>
#include <memory>
namespace sysy {
@@ -12,14 +10,12 @@ namespace sysy {
class RISCv64CodeGen {
public:
RISCv64CodeGen(Module* mod) : module(mod) {}
// 唯一的公共入口点
std::string code_gen();
private:
// 模块级代码生成 (处理全局变量和驱动函数生成)
// 模块级代码生成
std::string module_gen();
// 函数级代码生成 (实现新的流水线)
std::string function_gen(Function* func);