sirit/src/operand.cpp

42 lines
926 B
C++
Raw Normal View History

2018-08-26 01:16:37 +02:00
/* This file is part of the sirit project.
* Copyright (c) 2018 ReinUsesLisp
* This software may be used and distributed according to the terms of the GNU
2018-11-16 08:10:10 +01:00
* Lesser General Public License version 3 or any later version.
2018-08-26 01:16:37 +02:00
*/
2018-10-03 05:32:45 +02:00
#include <cassert>
2019-03-11 07:26:21 +01:00
#include "operand.h"
2018-08-26 01:16:37 +02:00
namespace Sirit {
Operand::Operand() = default;
2018-08-26 01:16:37 +02:00
Operand::~Operand() = default;
void Operand::Fetch([[maybe_unused]] Stream& stream) const {
2018-08-26 01:16:37 +02:00
assert(!"Fetching unimplemented operand");
}
u16 Operand::GetWordCount() const {
assert(!"Fetching unimplemented operand");
return 0;
}
bool Operand::operator==([[maybe_unused]] const Operand& other) const {
2019-03-11 07:26:21 +01:00
return false;
}
2018-08-26 01:16:37 +02:00
bool Operand::operator!=(const Operand& other) const {
return !(*this == other);
}
std::size_t Operand::Hash() const {
return static_cast<std::size_t>(operand_type) << 30;
}
2019-03-11 07:26:21 +01:00
OperandType Operand::GetType() const {
return operand_type;
}
2018-08-26 01:16:37 +02:00
} // namespace Sirit