mirror of
https://github.com/open-goal/jak-project
synced 2026-06-07 12:07:48 -04:00
a66ec7c601
* all-types: improve all-types generation * all-types: re-generate all-types * tests: remove the test reporting feature the format indeed doesn't work, and all current actions require too many permissions for forked PRs. I'll make my own eventually that works properly (use the new markdown feature) * all-types: put the states in the method table instead * all-types: replace all `*time*...uint64` fields with `time-frame` type * all-types: address feedback
60 lines
2.2 KiB
C++
60 lines
2.2 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <unordered_map>
|
|
|
|
#include <decompiler/ObjectFile/ObjectFileDB.h>
|
|
#include "decompiler/Function/Function.h"
|
|
#include "decompiler/util/DecompilerTypeSystem.h"
|
|
|
|
namespace decompiler {
|
|
|
|
struct TypeInspectorResult {
|
|
bool success = false;
|
|
int type_size = -1;
|
|
int type_method_count = -1;
|
|
int parent_method_count = 9;
|
|
std::optional<int> type_heap_base = {};
|
|
|
|
std::string warnings;
|
|
std::vector<Field> fields_of_type;
|
|
bool is_basic = false;
|
|
bool found_flags = false;
|
|
|
|
std::string type_name;
|
|
std::string parent_type_name;
|
|
u64 flags;
|
|
|
|
std::string print_as_deftype(
|
|
StructureType* old_game_type,
|
|
std::unordered_map<std::string, TypeInspectorResult>& previous_results,
|
|
DecompilerTypeSystem& previous_game_ts,
|
|
ObjectFileDB::PerObjectAllTypeInfo& object_file_meta);
|
|
};
|
|
|
|
struct TypeInspectorCache {
|
|
std::unordered_map<std::string, TypeInspectorResult> previous_results;
|
|
};
|
|
|
|
std::string inspect_inspect_method(Function& inspect_method,
|
|
const std::string& type_name,
|
|
DecompilerTypeSystem& dts,
|
|
LinkedObjectFile& file,
|
|
DecompilerTypeSystem& previous_game_ts,
|
|
TypeInspectorCache& ti_cache,
|
|
ObjectFileDB::PerObjectAllTypeInfo& object_file_meta);
|
|
|
|
std::string inspect_top_level_for_metadata(Function& top_level,
|
|
LinkedObjectFile& file,
|
|
DecompilerTypeSystem& dts,
|
|
DecompilerTypeSystem& previous_game_ts,
|
|
ObjectFileDB::PerObjectAllTypeInfo& object_file_meta);
|
|
|
|
std::string inspect_top_level_symbol_defines(Function& top_level,
|
|
LinkedObjectFile& file,
|
|
DecompilerTypeSystem& dts,
|
|
DecompilerTypeSystem& previous_game_ts,
|
|
ObjectFileDB::PerObjectAllTypeInfo& object_file_meta);
|
|
|
|
} // namespace decompiler
|