Platform fixes.

This commit is contained in:
Daniel Kirchner 2023-08-22 18:33:34 +02:00 committed by Nikola Matic
parent 13f34354d1
commit 6fbf85e5c4
2 changed files with 12 additions and 9 deletions

View File

@ -17,6 +17,7 @@
// SPDX-License-Identifier: GPL-3.0 // SPDX-License-Identifier: GPL-3.0
#pragma once #pragma once
#include <cstddef>
#include <set> #include <set>
#include <variant> #include <variant>
#include <vector> #include <vector>
@ -86,8 +87,8 @@ public:
} }
private: private:
friend class TypeSystem; friend class TypeSystem;
TypeConstructor(size_t _index): m_index(_index) {} TypeConstructor(std::size_t _index): m_index(_index) {}
size_t m_index = 0; std::size_t m_index = 0;
}; };
struct TypeConstant struct TypeConstant
@ -119,8 +120,8 @@ public:
} }
private: private:
friend class TypeSystem; friend class TypeSystem;
TypeClass(size_t _index): m_index(_index) {} TypeClass(std::size_t _index): m_index(_index) {}
size_t m_index = 0; std::size_t m_index = 0;
}; };
struct Sort struct Sort
@ -141,13 +142,13 @@ struct Arity
struct TypeVariable struct TypeVariable
{ {
size_t index() const { return m_index; } std::size_t index() const { return m_index; }
Sort const& sort() const { return m_sort; } Sort const& sort() const { return m_sort; }
private: private:
friend class TypeSystem; friend class TypeSystem;
size_t m_index = 0; std::size_t m_index = 0;
Sort m_sort; Sort m_sort;
TypeVariable(size_t _index, Sort _sort): m_index(_index), m_sort(std::move(_sort)) {} TypeVariable(std::size_t _index, Sort _sort): m_index(_index), m_sort(std::move(_sort)) {}
}; };
} }

View File

@ -32,6 +32,8 @@
#include <fmt/format.h> #include <fmt/format.h>
#include <unordered_map>
using namespace solidity; using namespace solidity;
using namespace solidity::frontend; using namespace solidity::frontend;
using namespace solidity::frontend::experimental; using namespace solidity::frontend::experimental;
@ -133,7 +135,7 @@ TypeSystem::TypeSystem()
m_primitiveTypeClasses.emplace(PrimitiveClass::Type, declarePrimitiveClass("type")); m_primitiveTypeClasses.emplace(PrimitiveClass::Type, declarePrimitiveClass("type"));
for (auto [type, name, arity]: std::initializer_list<std::tuple<PrimitiveType, char const*, uint64_t>>{ for (auto [type, name, arity]: std::initializer_list<std::tuple<PrimitiveType, char const*, size_t>>{
{PrimitiveType::TypeFunction, "tfun", 2}, {PrimitiveType::TypeFunction, "tfun", 2},
{PrimitiveType::Function, "fun", 2}, {PrimitiveType::Function, "fun", 2},
{PrimitiveType::Function, "itself", 1}, {PrimitiveType::Function, "itself", 1},
@ -157,7 +159,7 @@ TypeSystem::TypeSystem()
experimental::Type TypeSystem::freshVariable(Sort _sort) experimental::Type TypeSystem::freshVariable(Sort _sort)
{ {
uint64_t index = m_numTypeVariables++; size_t index = m_numTypeVariables++;
return TypeVariable(index, std::move(_sort)); return TypeVariable(index, std::move(_sort));
} }