2020-09-13 21:32:55 -04:00
|
|
|
#pragma once
|
|
|
|
|
2020-09-12 13:11:42 -04:00
|
|
|
#ifndef JAK_COMPILERSETTINGS_H
|
|
|
|
#define JAK_COMPILERSETTINGS_H
|
|
|
|
|
|
|
|
#include <unordered_map>
|
|
|
|
#include <string>
|
2020-09-17 21:47:52 -04:00
|
|
|
#include "common/goos/Object.h"
|
2020-09-12 13:11:42 -04:00
|
|
|
|
|
|
|
class CompilerSettings {
|
|
|
|
public:
|
|
|
|
CompilerSettings();
|
|
|
|
bool debug_print_ir = false;
|
|
|
|
bool debug_print_regalloc = false;
|
2020-09-12 20:41:12 -04:00
|
|
|
bool disable_math_const_prop = false;
|
|
|
|
bool emit_move_after_return = true;
|
2020-09-24 17:19:23 -04:00
|
|
|
bool print_timing = false;
|
2020-09-12 20:41:12 -04:00
|
|
|
|
2020-09-12 13:11:42 -04:00
|
|
|
void set(const std::string& name, const goos::Object& value);
|
|
|
|
|
|
|
|
private:
|
2020-09-24 17:19:23 -04:00
|
|
|
void link(bool& val, const std::string& name);
|
2020-09-12 13:11:42 -04:00
|
|
|
enum class SettingKind { BOOL, INVALID };
|
|
|
|
|
|
|
|
struct SettingsEntry {
|
|
|
|
SettingKind kind = SettingKind::INVALID;
|
|
|
|
goos::Object value;
|
|
|
|
bool* boolp = nullptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::unordered_map<std::string, SettingsEntry> m_settings;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // JAK_COMPILERSETTINGS_H
|