From edfc77bbbeccd6412cbed7c30942a1527225ae7e Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 28 Aug 2018 04:05:47 -0300 Subject: [PATCH] Rename opcodes -> insts --- src/CMakeLists.txt | 10 +++++----- src/{opcodes.h => insts.h} | 7 ------- src/{opcodes => insts}/constant.cpp | 2 +- src/{opcodes => insts}/flow.cpp | 2 +- src/{opcodes => insts}/function.cpp | 2 +- src/{opcodes => insts}/type.cpp | 2 +- src/sirit.cpp | 8 +++++++- 7 files changed, 16 insertions(+), 17 deletions(-) rename src/{opcodes.h => insts.h} (65%) rename src/{opcodes => insts}/constant.cpp (97%) rename src/{opcodes => insts}/flow.cpp (95%) rename src/{opcodes => insts}/function.cpp (96%) rename src/{opcodes => insts}/type.cpp (99%) 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;