mirror of
https://github.com/open-goal/jak-project
synced 2026-05-24 07:11:15 -04:00
cae3871730
* begin framework for expressions * more * clean up warnings * small fixes * update * wip type prop improvements * see if nasm works * fix format strings
29 lines
849 B
C++
29 lines
849 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include "decompiler/IR/IR.h"
|
|
#include "decompiler/Disasm/Register.h"
|
|
#include "decompiler/util/TP_Type.h"
|
|
|
|
class ExpressionStack {
|
|
public:
|
|
ExpressionStack() = default;
|
|
void set(Register reg, std::shared_ptr<IR> value);
|
|
std::shared_ptr<IR> get(Register reg);
|
|
bool is_single_expression();
|
|
std::string print(LinkedObjectFile& file);
|
|
std::vector<std::shared_ptr<IR>> get_result();
|
|
|
|
private:
|
|
struct StackEntry {
|
|
bool display = true; // should this appear in the output?
|
|
Register destination; // what register we are setting
|
|
std::shared_ptr<IR> source; // the value we are setting the register to.
|
|
// TP_Type type;
|
|
std::string print(LinkedObjectFile& file);
|
|
};
|
|
std::vector<StackEntry> m_stack;
|
|
|
|
bool display_stack_empty();
|
|
StackEntry& get_display_stack_top();
|
|
}; |