diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5610414..92540a3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,11 +9,11 @@ add_library(sirit operand.h literal.cpp common_types.h - opcodes.h - opcodes/type.cpp - opcodes/constant.cpp - opcodes/function.cpp - opcodes/flow.cpp + insts.h + insts/type.cpp + insts/constant.cpp + insts/function.cpp + insts/flow.cpp ) target_include_directories(sirit PUBLIC ../include diff --git a/src/opcodes.h b/src/insts.h similarity index 65% rename from src/opcodes.h rename to src/insts.h index 47159da..0e75141 100644 --- a/src/opcodes.h +++ b/src/insts.h @@ -11,11 +11,4 @@ namespace Sirit { -template -inline void WriteEnum(Stream& stream, spv::Op opcode, T value) { - Op op{opcode}; - op.Add(static_cast(value)); - op.Write(stream); -} - } // namespace Sirit diff --git a/src/opcodes/constant.cpp b/src/insts/constant.cpp similarity index 97% rename from src/opcodes/constant.cpp rename to src/insts/constant.cpp index aacd8a9..d691583 100644 --- a/src/opcodes/constant.cpp +++ b/src/insts/constant.cpp @@ -6,7 +6,7 @@ #include #include "sirit/sirit.h" -#include "opcodes.h" +#include "insts.h" namespace Sirit { diff --git a/src/opcodes/flow.cpp b/src/insts/flow.cpp similarity index 95% rename from src/opcodes/flow.cpp rename to src/insts/flow.cpp index bfe4f17..e1f0b4b 100644 --- a/src/opcodes/flow.cpp +++ b/src/insts/flow.cpp @@ -5,7 +5,7 @@ */ #include "sirit/sirit.h" -#include "opcodes.h" +#include "insts.h" namespace Sirit { diff --git a/src/opcodes/function.cpp b/src/insts/function.cpp similarity index 96% rename from src/opcodes/function.cpp rename to src/insts/function.cpp index 345e6d6..210832e 100644 --- a/src/opcodes/function.cpp +++ b/src/insts/function.cpp @@ -5,7 +5,7 @@ */ #include "sirit/sirit.h" -#include "opcodes.h" +#include "insts.h" namespace Sirit { diff --git a/src/opcodes/type.cpp b/src/insts/type.cpp similarity index 99% rename from src/opcodes/type.cpp rename to src/insts/type.cpp index e7c16fb..a3cde94 100644 --- a/src/opcodes/type.cpp +++ b/src/insts/type.cpp @@ -6,7 +6,7 @@ #include #include "sirit/sirit.h" -#include "opcodes.h" +#include "insts.h" namespace Sirit { diff --git a/src/sirit.cpp b/src/sirit.cpp index a9b1ec7..6729085 100644 --- a/src/sirit.cpp +++ b/src/sirit.cpp @@ -10,10 +10,16 @@ #include "common_types.h" #include "op.h" #include "stream.h" -#include "opcodes.h" namespace Sirit { +template +inline void WriteEnum(Stream& stream, spv::Op opcode, T value) { + Op op{opcode}; + op.Add(static_cast(value)); + op.Write(stream); +} + Module::Module() {} Module::~Module() = default;