mirror of
https://github.com/azahar-emu/sirit.git
synced 2026-03-20 19:21:03 +01:00
operand: Implement operand hashing and use hashed set for declarations
Instead of manually searching each element in the declarations vector, use an unordered_set to emplace new declarations avoiding repetition.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <typeindex>
|
||||
#include "operand.h"
|
||||
@@ -23,6 +24,8 @@ public:
|
||||
|
||||
bool operator==(const Operand& other) const override;
|
||||
|
||||
std::size_t Hash() const override;
|
||||
|
||||
template <typename T>
|
||||
static LiteralNumber* Create(T value) {
|
||||
static_assert(sizeof(T) == 4 || sizeof(T) == 8);
|
||||
|
||||
Reference in New Issue
Block a user