2020-09-13 21:32:55 -04:00
|
|
|
#pragma once
|
|
|
|
|
2020-09-05 16:37:37 -04:00
|
|
|
/*!
|
|
|
|
* IRegister is the Register for the Intermediate Representation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include "goalc/emitter/Register.h"
|
|
|
|
|
|
|
|
struct IRegister {
|
2020-12-30 15:33:51 -05:00
|
|
|
RegClass reg_class = RegClass::INVALID;
|
2020-09-05 16:37:37 -04:00
|
|
|
int id = -1;
|
|
|
|
std::string to_string() const;
|
|
|
|
struct hash {
|
|
|
|
auto operator()(const IRegister& r) const { return std::hash<int>()(r.id); }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IRegConstraint {
|
|
|
|
IRegister ireg;
|
|
|
|
int instr_idx = -1;
|
2020-12-04 12:57:10 -05:00
|
|
|
bool contrain_everywhere = false;
|
2020-09-05 16:37:37 -04:00
|
|
|
emitter::Register desired_register;
|
|
|
|
std::string to_string() const;
|
|
|
|
};
|