#ifndef LLVM_CODEGEN_MACHINELOCATION_H
#define LLVM_CODEGEN_MACHINELOCATION_H
namespace llvm {
class MachineLocation {
private:
bool IsRegister; unsigned Register; int Offset;
public:
enum {
VirtualFP = ~0U
};
MachineLocation()
: IsRegister(false)
, Register(0)
, Offset(0)
{}
explicit MachineLocation(unsigned R)
: IsRegister(true)
, Register(R)
, Offset(0)
{}
MachineLocation(unsigned R, int O)
: IsRegister(false)
, Register(R)
, Offset(O)
{}
bool isReg() const { return IsRegister; }
unsigned getReg() const { return Register; }
int getOffset() const { return Offset; }
void setIsRegister(bool Is) { IsRegister = Is; }
void setRegister(unsigned R) { Register = R; }
void setOffset(int O) { Offset = O; }
void set(unsigned R) {
IsRegister = true;
Register = R;
Offset = 0;
}
void set(unsigned R, int O) {
IsRegister = false;
Register = R;
Offset = O;
}
#ifndef NDEBUG
void dump();
#endif
};
class MachineMove {
private:
unsigned LabelID; MachineLocation Destination; MachineLocation Source;
public:
MachineMove()
: LabelID(0)
, Destination()
, Source()
{}
MachineMove(unsigned ID, MachineLocation &D, MachineLocation &S)
: LabelID(ID)
, Destination(D)
, Source(S)
{}
unsigned getLabelID() const { return LabelID; }
const MachineLocation &getDestination() const { return Destination; }
const MachineLocation &getSource() const { return Source; }
};
}
#endif