From b25df642da3d841634a3a2ccfe1834cb935b13c1 Mon Sep 17 00:00:00 2001 From: Alexander McCord Date: Sun, 2 Jun 2024 19:41:34 -0700 Subject: [PATCH] Move the macros to be at the top. --- EqSat/include/Luau/Language.h | 45 +++++++++++++++-------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/EqSat/include/Luau/Language.h b/EqSat/include/Luau/Language.h index 5f8e0ba0..d606c1db 100644 --- a/EqSat/include/Luau/Language.h +++ b/EqSat/include/Luau/Language.h @@ -9,32 +9,6 @@ #include #include -namespace Luau::EqSat -{ - -template -struct LanguageHash -{ - size_t operator()(const T&) const - { - // See available specializations at the bottom of this file. - static_assert(false, "missing languageHash specialization"); - } -}; - -template -std::size_t languageHash(const T& lang) -{ - return LanguageHash{}(lang); -} - -// We have four different kinds of declarations: -// -// Atom, the root data type that holds the value in question. -// NodeArray, a fixed sized sequence of `Id`s. -// NodeVector, a dynamically sized sequence of `Id`s. -// NodeFields, a fixed sized sequence of `Id`s accessed by field names rather than subscripts. - #define LUAU_EQSAT_ATOM(name, t) \ struct name : public ::Luau::EqSat::Atom \ { \ @@ -68,6 +42,25 @@ std::size_t languageHash(const T& lang) using NodeFields::NodeFields; \ } +namespace Luau::EqSat +{ + +template +struct LanguageHash +{ + size_t operator()(const T&) const + { + // See available specializations at the bottom of this file. + static_assert(false, "missing languageHash specialization"); + } +}; + +template +std::size_t languageHash(const T& lang) +{ + return LanguageHash{}(lang); +} + template struct Atom {