mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
6e0ff4c9d0
* fix parent issue * fix compiler issue * update * add error messages * fix error * fix array access, temporary * more clean * fix * rename arg variables better * fix method name * fix no return value in decompiler * many small fixes * cheat types so it works * name map * fix old test'
29 lines
732 B
C++
29 lines
732 B
C++
/*!
|
|
* @file CodeGenerator.h
|
|
* Generate object files from a FileEnv using an emitter::ObjectGenerator.
|
|
* Populates a DebugInfo.
|
|
* Currently owns the logic for emitting the function prologues.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "Env.h"
|
|
#include "goalc/emitter/ObjectGenerator.h"
|
|
|
|
class DebugInfo;
|
|
class TypeSystem;
|
|
|
|
class CodeGenerator {
|
|
public:
|
|
CodeGenerator(FileEnv* env, DebugInfo* debug_info);
|
|
std::vector<u8> run(const TypeSystem* ts);
|
|
|
|
private:
|
|
void do_function(FunctionEnv* env, int f_idx);
|
|
void do_goal_function(FunctionEnv* env, int f_idx);
|
|
void do_asm_function(FunctionEnv* env, int f_idx, bool allow_saved_regs);
|
|
emitter::ObjectGenerator m_gen;
|
|
FileEnv* m_fe = nullptr;
|
|
DebugInfo* m_debug_info = nullptr;
|
|
};
|