[ir][spirv-writer] Move code to `ir` subdirectory

Also add `_ir` to the names of test files.This makes it less likely to
confuse IR code with non-IR code.

Bug: tint:1906
Change-Id: I2db85440c815c2834d7bab1899afa0fafc89ce6a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/133222
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Commit-Queue: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
James Price 2023-05-17 19:51:42 +00:00 committed by Dawn LUCI CQ
parent 90b8cc1e93
commit 54d1d714ce
12 changed files with 35 additions and 34 deletions

View File

@ -1028,8 +1028,8 @@ libtint_source_set("libtint_spv_writer_src") {
if (tint_build_ir) {
sources += [
"writer/spirv/generator_impl_ir.cc",
"writer/spirv/generator_impl_ir.h",
"writer/spirv/ir/generator_impl_ir.cc",
"writer/spirv/ir/generator_impl_ir.h",
]
deps += [
":libtint_ir_builder_src",
@ -1939,12 +1939,13 @@ if (tint_build_unittests) {
if (tint_build_ir) {
sources += [
"writer/spirv/generator_impl_binary_test.cc",
"writer/spirv/generator_impl_constant_test.cc",
"writer/spirv/generator_impl_function_test.cc",
"writer/spirv/generator_impl_if_test.cc",
"writer/spirv/generator_impl_ir_test.cc",
"writer/spirv/generator_impl_type_test.cc",
"writer/spirv/ir/generator_impl_ir_binary_test.cc",
"writer/spirv/ir/generator_impl_ir_constant_test.cc",
"writer/spirv/ir/generator_impl_ir_function_test.cc",
"writer/spirv/ir/generator_impl_ir_if_test.cc",
"writer/spirv/ir/generator_impl_ir_test.cc",
"writer/spirv/ir/generator_impl_ir_type_test.cc",
"writer/spirv/ir/test_helper_ir.h",
]
deps += [ ":libtint_ir_src" ]
}

View File

@ -656,8 +656,8 @@ if(${TINT_BUILD_SPV_WRITER})
if(${TINT_BUILD_IR})
list(APPEND TINT_LIB_SRCS
writer/spirv/generator_impl_ir.cc
writer/spirv/generator_impl_ir.h
writer/spirv/ir/generator_impl_ir.cc
writer/spirv/ir/generator_impl_ir.h
)
endif()
endif()
@ -1240,13 +1240,13 @@ if(TINT_BUILD_TESTS)
if(${TINT_BUILD_IR})
list(APPEND TINT_TEST_SRCS
writer/spirv/generator_impl_binary_test.cc
writer/spirv/generator_impl_constant_test.cc
writer/spirv/generator_impl_function_test.cc
writer/spirv/generator_impl_if_test.cc
writer/spirv/generator_impl_ir_test.cc
writer/spirv/generator_impl_type_test.cc
writer/spirv/test_helper_ir.h
writer/spirv/ir/generator_impl_ir_binary_test.cc
writer/spirv/ir/generator_impl_ir_constant_test.cc
writer/spirv/ir/generator_impl_ir_function_test.cc
writer/spirv/ir/generator_impl_ir_if_test.cc
writer/spirv/ir/generator_impl_ir_test.cc
writer/spirv/ir/generator_impl_ir_type_test.cc
writer/spirv/ir/test_helper_ir.h
)
endif()
endif()

View File

@ -18,9 +18,9 @@
#include "src/tint/writer/spirv/generator_impl.h"
#if TINT_BUILD_IR
#include "src/tint/ir/from_program.h" // nogncheck
#include "src/tint/writer/spirv/generator_impl_ir.h" // nogncheck
#endif // TINT_BUILD_IR
#include "src/tint/ir/from_program.h" // nogncheck
#include "src/tint/writer/spirv/ir/generator_impl_ir.h" // nogncheck
#endif // TINT_BUILD_IR
namespace tint::writer::spirv {

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/tint/writer/spirv/generator_impl_ir.h"
#include "src/tint/writer/spirv/ir/generator_impl_ir.h"
#include "spirv/unified1/spirv.h"
#include "src/tint/ir/binary.h"

View File

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SRC_TINT_WRITER_SPIRV_GENERATOR_IMPL_IR_H_
#define SRC_TINT_WRITER_SPIRV_GENERATOR_IMPL_IR_H_
#ifndef SRC_TINT_WRITER_SPIRV_IR_GENERATOR_IMPL_IR_H_
#define SRC_TINT_WRITER_SPIRV_IR_GENERATOR_IMPL_IR_H_
#include <vector>
@ -182,4 +182,4 @@ class GeneratorImplIr {
} // namespace tint::writer::spirv
#endif // SRC_TINT_WRITER_SPIRV_GENERATOR_IMPL_IR_H_
#endif // SRC_TINT_WRITER_SPIRV_IR_GENERATOR_IMPL_IR_H_

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/tint/writer/spirv/test_helper_ir.h"
#include "src/tint/writer/spirv/ir/test_helper_ir.h"
using namespace tint::number_suffixes; // NOLINT

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/tint/writer/spirv/test_helper_ir.h"
#include "src/tint/writer/spirv/ir/test_helper_ir.h"
namespace tint::writer::spirv {
namespace {

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/tint/writer/spirv/test_helper_ir.h"
#include "src/tint/writer/spirv/ir/test_helper_ir.h"
namespace tint::writer::spirv {
namespace {

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/tint/writer/spirv/test_helper_ir.h"
#include "src/tint/writer/spirv/ir/test_helper_ir.h"
using namespace tint::number_suffixes; // NOLINT

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "src/tint/writer/spirv/test_helper_ir.h"
#include "src/tint/writer/spirv/ir/test_helper_ir.h"
#include "gmock/gmock.h"

View File

@ -19,7 +19,7 @@
#include "src/tint/type/type.h"
#include "src/tint/type/u32.h"
#include "src/tint/type/void.h"
#include "src/tint/writer/spirv/test_helper_ir.h"
#include "src/tint/writer/spirv/ir/test_helper_ir.h"
namespace tint::writer::spirv {
namespace {

View File

@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SRC_TINT_WRITER_SPIRV_TEST_HELPER_IR_H_
#define SRC_TINT_WRITER_SPIRV_TEST_HELPER_IR_H_
#ifndef SRC_TINT_WRITER_SPIRV_IR_TEST_HELPER_IR_H_
#define SRC_TINT_WRITER_SPIRV_IR_TEST_HELPER_IR_H_
#include <string>
#include "gtest/gtest.h"
#include "src/tint/ir/builder.h"
#include "src/tint/writer/spirv/generator_impl_ir.h"
#include "src/tint/writer/spirv/ir/generator_impl_ir.h"
#include "src/tint/writer/spirv/spv_dump.h"
namespace tint::writer::spirv {
@ -50,4 +50,4 @@ using SpvGeneratorImplTestWithParam = SpvGeneratorTestHelperBase<testing::TestWi
} // namespace tint::writer::spirv
#endif // SRC_TINT_WRITER_SPIRV_TEST_HELPER_IR_H_
#endif // SRC_TINT_WRITER_SPIRV_IR_TEST_HELPER_IR_H_