Remove the context object.
This CL strips the context object out of Tint. Change-Id: Id0dcb9c557b217c03a8d9ac08fc9fe1c799f3fdc Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34742 Commit-Queue: dan sinclair <dsinclair@chromium.org> Reviewed-by: Ben Clayton <bclayton@google.com> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
parent
bd018d254d
commit
c35176eadf
12
BUILD.gn
12
BUILD.gn
|
@ -331,6 +331,7 @@ source_set("libtint_core_src") {
|
|||
"src/ast/struct_member_offset_decoration.h",
|
||||
"src/ast/switch_statement.cc",
|
||||
"src/ast/switch_statement.h",
|
||||
"src/ast/traits.h",
|
||||
"src/ast/type/access_control_type.cc",
|
||||
"src/ast/type/access_control_type.h",
|
||||
"src/ast/type/alias_type.cc",
|
||||
|
@ -369,7 +370,6 @@ source_set("libtint_core_src") {
|
|||
"src/ast/type/vector_type.h",
|
||||
"src/ast/type/void_type.cc",
|
||||
"src/ast/type/void_type.h",
|
||||
"src/ast/traits.h",
|
||||
"src/ast/type_constructor_expression.cc",
|
||||
"src/ast/type_constructor_expression.h",
|
||||
"src/ast/type_decoration.cc",
|
||||
|
@ -392,8 +392,6 @@ source_set("libtint_core_src") {
|
|||
"src/ast/workgroup_decoration.h",
|
||||
"src/castable.cc",
|
||||
"src/castable.h",
|
||||
"src/context.cc",
|
||||
"src/context.h",
|
||||
"src/diagnostic/diagnostic.cc",
|
||||
"src/diagnostic/diagnostic.h",
|
||||
"src/diagnostic/formatter.cc",
|
||||
|
@ -413,10 +411,10 @@ source_set("libtint_core_src") {
|
|||
"src/scope_stack.h",
|
||||
"src/source.cc",
|
||||
"src/source.h",
|
||||
"src/transform/emit_vertex_point_size.cc",
|
||||
"src/transform/emit_vertex_point_size.h",
|
||||
"src/transform/bound_array_accessors.cc",
|
||||
"src/transform/bound_array_accessors.h",
|
||||
"src/transform/emit_vertex_point_size.cc",
|
||||
"src/transform/emit_vertex_point_size.h",
|
||||
"src/transform/manager.cc",
|
||||
"src/transform/manager.h",
|
||||
"src/transform/transform.cc",
|
||||
|
@ -791,6 +789,7 @@ source_set("tint_unittests_core_src") {
|
|||
"src/ast/struct_test.cc",
|
||||
"src/ast/switch_statement_test.cc",
|
||||
"src/ast/test_helper.h",
|
||||
"src/ast/traits_test.cc",
|
||||
"src/ast/type/access_control_type_test.cc",
|
||||
"src/ast/type/alias_type_test.cc",
|
||||
"src/ast/type/array_type_test.cc",
|
||||
|
@ -807,7 +806,6 @@ source_set("tint_unittests_core_src") {
|
|||
"src/ast/type/struct_type_test.cc",
|
||||
"src/ast/type/u32_type_test.cc",
|
||||
"src/ast/type/vector_type_test.cc",
|
||||
"src/ast/traits_test.cc",
|
||||
"src/ast/type_constructor_expression_test.cc",
|
||||
"src/ast/type_manager_test.cc",
|
||||
"src/ast/uint_literal_test.cc",
|
||||
|
@ -821,8 +819,8 @@ source_set("tint_unittests_core_src") {
|
|||
"src/inspector/inspector_test.cc",
|
||||
"src/namer_test.cc",
|
||||
"src/scope_stack_test.cc",
|
||||
"src/transform/emit_vertex_point_size_test.cc",
|
||||
"src/transform/bound_array_accessors_test.cc",
|
||||
"src/transform/emit_vertex_point_size_test.cc",
|
||||
"src/transform/vertex_pulling_test.cc",
|
||||
"src/type_determiner_test.cc",
|
||||
"src/validator/validator_control_block_test.cc",
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
|
||||
#include "src/ast/pipeline_stage.h"
|
||||
#include "src/ast/type_manager.h"
|
||||
#include "src/context.h"
|
||||
#include "src/diagnostic/printer.h"
|
||||
#include "src/inspector/inspector.h"
|
||||
#include "src/namer.h"
|
||||
|
|
|
@ -213,8 +213,6 @@ set(TINT_LIB_SRCS
|
|||
ast/workgroup_decoration.h
|
||||
castable.cc
|
||||
castable.h
|
||||
context.cc
|
||||
context.h
|
||||
diagnostic/diagnostic.cc
|
||||
diagnostic/diagnostic.h
|
||||
diagnostic/formatter.cc
|
||||
|
|
|
@ -12,9 +12,10 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "src/ast/case_statement.h"
|
||||
#include <unordered_set>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/case_statement.h"
|
||||
#include "src/reader/wgsl/parser.h"
|
||||
#include "src/writer/wgsl/generator.h"
|
||||
|
||||
|
@ -107,8 +108,7 @@ fn main() -> void {
|
|||
)");
|
||||
|
||||
// Parse the wgsl, create the src module
|
||||
Context ctx;
|
||||
reader::wgsl::Parser parser(&ctx, &file);
|
||||
reader::wgsl::Parser parser(&file);
|
||||
ASSERT_TRUE(parser.Parse()) << parser.error();
|
||||
auto src = parser.module();
|
||||
|
||||
|
|
|
@ -92,12 +92,11 @@ TEST_F(StorageTextureTest, TypeName) {
|
|||
}
|
||||
|
||||
TEST_F(StorageTextureTest, F32) {
|
||||
Context ctx;
|
||||
Module mod;
|
||||
Type* s = mod.create<StorageTexture>(TextureDimension::k2dArray,
|
||||
ast::AccessControl::kReadOnly,
|
||||
ImageFormat::kRgba32Float);
|
||||
TypeDeterminer td(&ctx, &mod);
|
||||
TypeDeterminer td(&mod);
|
||||
|
||||
ASSERT_TRUE(td.Determine()) << td.error();
|
||||
ASSERT_TRUE(s->Is<Texture>());
|
||||
|
@ -106,12 +105,11 @@ TEST_F(StorageTextureTest, F32) {
|
|||
}
|
||||
|
||||
TEST_F(StorageTextureTest, U32) {
|
||||
Context ctx;
|
||||
Module mod;
|
||||
Type* s = mod.create<StorageTexture>(TextureDimension::k2dArray,
|
||||
ast::AccessControl::kReadOnly,
|
||||
ImageFormat::kRg32Uint);
|
||||
TypeDeterminer td(&ctx, &mod);
|
||||
TypeDeterminer td(&mod);
|
||||
|
||||
ASSERT_TRUE(td.Determine()) << td.error();
|
||||
ASSERT_TRUE(s->Is<Texture>());
|
||||
|
@ -120,12 +118,11 @@ TEST_F(StorageTextureTest, U32) {
|
|||
}
|
||||
|
||||
TEST_F(StorageTextureTest, I32) {
|
||||
Context ctx;
|
||||
Module mod;
|
||||
Type* s = mod.create<StorageTexture>(TextureDimension::k2dArray,
|
||||
ast::AccessControl::kReadOnly,
|
||||
ImageFormat::kRgba32Sint);
|
||||
TypeDeterminer td(&ctx, &mod);
|
||||
TypeDeterminer td(&mod);
|
||||
|
||||
ASSERT_TRUE(td.Determine()) << td.error();
|
||||
ASSERT_TRUE(s->Is<Texture>());
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
// Copyright 2020 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include "src/context.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "src/ast/node.h"
|
||||
#include "src/namer.h"
|
||||
|
||||
namespace tint {
|
||||
|
||||
Context::Context() = default;
|
||||
|
||||
Context::Context(std::unique_ptr<Namer>) {}
|
||||
|
||||
Context::~Context() = default;
|
||||
|
||||
} // namespace tint
|
|
@ -1,48 +0,0 @@
|
|||
// Copyright 2020 The Tint Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef SRC_CONTEXT_H_
|
||||
#define SRC_CONTEXT_H_
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "src/namer.h"
|
||||
|
||||
namespace tint {
|
||||
|
||||
namespace ast {
|
||||
class Node;
|
||||
}
|
||||
|
||||
/// Context object for Tint. Holds various global resources used through
|
||||
/// the system.
|
||||
class Context {
|
||||
public:
|
||||
/// Constructor
|
||||
Context();
|
||||
/// Constructor
|
||||
/// @param namer the namer to set into the context
|
||||
explicit Context(std::unique_ptr<Namer> namer);
|
||||
/// Destructor
|
||||
~Context();
|
||||
};
|
||||
|
||||
} // namespace tint
|
||||
|
||||
#endif // SRC_CONTEXT_H_
|
|
@ -45,9 +45,6 @@ namespace inspector {
|
|||
|
||||
Inspector::Inspector(const ast::Module& module) : module_(module) {}
|
||||
|
||||
Inspector::Inspector(Context*, const ast::Module& module)
|
||||
: Inspector(std::move(module)) {}
|
||||
|
||||
Inspector::~Inspector() = default;
|
||||
|
||||
std::vector<EntryPoint> Inspector::GetEntryPoints() {
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
#include "src/ast/module.h"
|
||||
#include "src/ast/pipeline_stage.h"
|
||||
#include "src/context.h"
|
||||
#include "src/inspector/entry_point.h"
|
||||
#include "src/inspector/scalar.h"
|
||||
|
||||
|
@ -74,11 +73,6 @@ class Inspector {
|
|||
/// Constructor
|
||||
/// @param module Shader module to extract information from.
|
||||
explicit Inspector(const ast::Module& module);
|
||||
/// Constructor
|
||||
/// DEPRECATED
|
||||
/// @param ctx the context, must be non-null
|
||||
/// @param module Shader module to extract information from.
|
||||
Inspector(Context* ctx, const ast::Module& module);
|
||||
~Inspector();
|
||||
|
||||
/// @returns error messages from the Inspector
|
||||
|
|
|
@ -23,9 +23,6 @@ namespace spirv {
|
|||
Parser::Parser(const std::vector<uint32_t>& spv_binary)
|
||||
: Reader(), impl_(std::make_unique<ParserImpl>(spv_binary)) {}
|
||||
|
||||
Parser::Parser(Context*, const std::vector<uint32_t>& spv_binary)
|
||||
: Parser(spv_binary) {}
|
||||
|
||||
Parser::~Parser() = default;
|
||||
|
||||
bool Parser::Parse() {
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "src/context.h"
|
||||
#include "src/reader/reader.h"
|
||||
|
||||
namespace tint {
|
||||
|
@ -34,11 +33,6 @@ class Parser : public Reader {
|
|||
/// Creates a new parser
|
||||
/// @param input the input data to parse
|
||||
explicit Parser(const std::vector<uint32_t>& input);
|
||||
/// Creates a new parser
|
||||
/// DEPRECATED
|
||||
/// @param ctx the non-null context object
|
||||
/// @param input the input data to parse
|
||||
Parser(Context* ctx, const std::vector<uint32_t>& input);
|
||||
/// Destructor
|
||||
~Parser() override;
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/context.h"
|
||||
|
||||
namespace tint {
|
||||
namespace reader {
|
||||
|
@ -29,8 +28,7 @@ using ParserTest = testing::Test;
|
|||
|
||||
TEST_F(ParserTest, Uint32VecEmpty) {
|
||||
std::vector<uint32_t> data;
|
||||
Context ctx;
|
||||
Parser p(&ctx, data);
|
||||
Parser p(data);
|
||||
EXPECT_FALSE(p.Parse());
|
||||
// TODO(dneto): What message?
|
||||
}
|
||||
|
|
|
@ -25,8 +25,6 @@ namespace wgsl {
|
|||
Parser::Parser(Source::File const* file)
|
||||
: Reader(), impl_(std::make_unique<ParserImpl>(file)) {}
|
||||
|
||||
Parser::Parser(Context*, Source::File const* file) : Parser(file) {}
|
||||
|
||||
Parser::~Parser() = default;
|
||||
|
||||
bool Parser::Parse() {
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "src/context.h"
|
||||
#include "src/reader/reader.h"
|
||||
#include "src/source.h"
|
||||
|
||||
|
@ -34,11 +33,6 @@ class Parser : public Reader {
|
|||
/// Creates a new parser from the given file.
|
||||
/// @param file the input source file to parse
|
||||
explicit Parser(Source::File const* file);
|
||||
/// Creates a new parser from the given file.
|
||||
/// DEPRECATED
|
||||
/// @param ctx the non-null context object
|
||||
/// @param file the input source file to parse
|
||||
Parser(Context* ctx, Source::File const* file);
|
||||
~Parser() override;
|
||||
|
||||
/// Run the parser
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include <vector>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/context.h"
|
||||
#include "src/reader/wgsl/parser_impl.h"
|
||||
|
||||
namespace tint {
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "src/reader/wgsl/parser.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/context.h"
|
||||
|
||||
namespace tint {
|
||||
namespace reader {
|
||||
|
@ -25,14 +24,12 @@ namespace {
|
|||
using ParserTest = testing::Test;
|
||||
|
||||
TEST_F(ParserTest, Empty) {
|
||||
Context ctx;
|
||||
Source::File file("test.wgsl", "");
|
||||
Parser p(&ctx, &file);
|
||||
Parser p(&file);
|
||||
ASSERT_TRUE(p.Parse()) << p.error();
|
||||
}
|
||||
|
||||
TEST_F(ParserTest, Parses) {
|
||||
Context ctx;
|
||||
Source::File file("test.wgsl", R"(
|
||||
[[location(0)]] var<out> gl_FragColor : vec4<f32>;
|
||||
|
||||
|
@ -41,7 +38,7 @@ fn main() -> void {
|
|||
gl_FragColor = vec4<f32>(.4, .2, .3, 1);
|
||||
}
|
||||
)");
|
||||
Parser p(&ctx, &file);
|
||||
Parser p(&file);
|
||||
ASSERT_TRUE(p.Parse()) << p.error();
|
||||
|
||||
auto m = p.module();
|
||||
|
@ -50,12 +47,11 @@ fn main() -> void {
|
|||
}
|
||||
|
||||
TEST_F(ParserTest, HandlesError) {
|
||||
Context ctx;
|
||||
Source::File file("test.wgsl", R"(
|
||||
fn main() -> { # missing return type
|
||||
return;
|
||||
})");
|
||||
Parser p(&ctx, &file);
|
||||
Parser p(&file);
|
||||
|
||||
ASSERT_FALSE(p.Parse());
|
||||
ASSERT_TRUE(p.has_error());
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "src/ast/expression.h"
|
||||
#include "src/ast/module.h"
|
||||
#include "src/ast/statement.h"
|
||||
#include "src/context.h"
|
||||
#include "src/scope_stack.h"
|
||||
#include "src/transform/transform.h"
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include <utility>
|
||||
|
||||
#include "src/ast/module.h"
|
||||
#include "src/context.h"
|
||||
#include "src/diagnostic/diagnostic.h"
|
||||
|
||||
namespace tint {
|
||||
|
|
|
@ -58,7 +58,7 @@ class VertexPullingHelper {
|
|||
void InitTransform(VertexStateDescriptor vertex_state) {
|
||||
EXPECT_TRUE(mod_->IsValid());
|
||||
|
||||
TypeDeterminer td(&ctx_, mod_.get());
|
||||
TypeDeterminer td(mod_.get());
|
||||
EXPECT_TRUE(td.Determine());
|
||||
|
||||
transform_->SetVertexState(vertex_state);
|
||||
|
@ -80,6 +80,7 @@ class VertexPullingHelper {
|
|||
}
|
||||
|
||||
ast::Module* mod() { return mod_.get(); }
|
||||
|
||||
Manager* manager() { return manager_.get(); }
|
||||
VertexPulling* transform() { return transform_; }
|
||||
|
||||
|
@ -93,7 +94,6 @@ class VertexPullingHelper {
|
|||
}
|
||||
|
||||
private:
|
||||
Context ctx_;
|
||||
std::unique_ptr<ast::Module> mod_;
|
||||
std::unique_ptr<Manager> manager_;
|
||||
VertexPulling* transform_;
|
||||
|
|
|
@ -60,9 +60,6 @@ namespace tint {
|
|||
|
||||
TypeDeterminer::TypeDeterminer(ast::Module* mod) : mod_(mod) {}
|
||||
|
||||
TypeDeterminer::TypeDeterminer(Context*, ast::Module* mod)
|
||||
: TypeDeterminer(mod) {}
|
||||
|
||||
TypeDeterminer::~TypeDeterminer() = default;
|
||||
|
||||
void TypeDeterminer::set_error(const Source& src, const std::string& msg) {
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
#include "src/ast/module.h"
|
||||
#include "src/ast/type/storage_texture_type.h"
|
||||
#include "src/context.h"
|
||||
#include "src/scope_stack.h"
|
||||
|
||||
namespace tint {
|
||||
|
@ -46,11 +45,6 @@ class TypeDeterminer {
|
|||
/// Constructor
|
||||
/// @param mod the module to update with typing information
|
||||
explicit TypeDeterminer(ast::Module* mod);
|
||||
/// Constructor
|
||||
/// DEPRECATED
|
||||
/// @param ctx the tint context, must be non-null
|
||||
/// @param mod the module to update with typing information
|
||||
TypeDeterminer(Context* ctx, ast::Module* mod);
|
||||
~TypeDeterminer();
|
||||
|
||||
/// @returns error messages from the type determiner
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
namespace tint {
|
||||
|
||||
ValidatorTestHelper::ValidatorTestHelper() {
|
||||
td_ = std::make_unique<TypeDeterminer>(&ctx_, &mod_);
|
||||
td_ = std::make_unique<TypeDeterminer>(&mod_);
|
||||
v_ = std::make_unique<ValidatorImpl>();
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,6 @@ class ValidatorTestHelper {
|
|||
|
||||
private:
|
||||
std::unique_ptr<ValidatorImpl> v_;
|
||||
Context ctx_;
|
||||
ast::Module mod_;
|
||||
std::unique_ptr<TypeDeterminer> td_;
|
||||
ast::type::Void void_type_;
|
||||
|
|
|
@ -24,9 +24,6 @@ Generator::Generator(ast::Module module)
|
|||
: Text(std::move(module)),
|
||||
impl_(std::make_unique<GeneratorImpl>(&module_)) {}
|
||||
|
||||
Generator::Generator(Context*, ast::Module module)
|
||||
: Generator(std::move(module)) {}
|
||||
|
||||
Generator::~Generator() = default;
|
||||
|
||||
void Generator::Reset() {
|
||||
|
|
|
@ -32,11 +32,6 @@ class Generator : public Text {
|
|||
/// Constructor
|
||||
/// @param module the module to convert
|
||||
explicit Generator(ast::Module module);
|
||||
/// Constructor
|
||||
/// DEPRECATED
|
||||
/// @param ctx the context, must be non-null
|
||||
/// @param module the module to convert
|
||||
Generator(Context* ctx, ast::Module module);
|
||||
~Generator() override;
|
||||
|
||||
/// Resets the generator
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "src/ast/type/vector_type.h"
|
||||
#include "src/ast/type/void_type.h"
|
||||
#include "src/ast/variable.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/hlsl/test_helper.h"
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
#include "src/ast/variable.h"
|
||||
#include "src/ast/variable_decl_statement.h"
|
||||
#include "src/ast/workgroup_decoration.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/hlsl/test_helper.h"
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "src/ast/type/matrix_type.h"
|
||||
#include "src/ast/type/vector_type.h"
|
||||
#include "src/ast/type_constructor_expression.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/hlsl/test_helper.h"
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#include "src/ast/module.h"
|
||||
#include "src/ast/type/f32_type.h"
|
||||
#include "src/ast/type/vector_type.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/hlsl/test_helper.h"
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "src/ast/intrinsic_texture_helper_test.h"
|
||||
#include "src/ast/type/depth_texture_type.h"
|
||||
#include "src/ast/type/sampled_texture_type.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/hlsl/generator_impl.h"
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "src/ast/type/struct_type.h"
|
||||
#include "src/ast/type/vector_type.h"
|
||||
#include "src/ast/type_constructor_expression.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/hlsl/test_helper.h"
|
||||
|
||||
|
|
|
@ -24,9 +24,6 @@ Generator::Generator(ast::Module module)
|
|||
: Text(std::move(module)),
|
||||
impl_(std::make_unique<GeneratorImpl>(&module_)) {}
|
||||
|
||||
Generator::Generator(Context*, ast::Module module)
|
||||
: Generator(std::move(module)) {}
|
||||
|
||||
Generator::~Generator() = default;
|
||||
|
||||
void Generator::Reset() {
|
||||
|
|
|
@ -31,11 +31,6 @@ class Generator : public Text {
|
|||
/// Constructor
|
||||
/// @param module the module to convert
|
||||
explicit Generator(ast::Module module);
|
||||
/// Constructor
|
||||
/// DEPRECATED
|
||||
/// @param ctx the context object, must be non-null
|
||||
/// @param module the module to convert
|
||||
Generator(Context* ctx, ast::Module module);
|
||||
~Generator() override;
|
||||
|
||||
/// Resets the generator
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "src/ast/type/vector_type.h"
|
||||
#include "src/ast/type/void_type.h"
|
||||
#include "src/ast/variable.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/msl/generator_impl.h"
|
||||
#include "src/writer/msl/test_helper.h"
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
#include "src/ast/type/void_type.h"
|
||||
#include "src/ast/variable.h"
|
||||
#include "src/ast/variable_decl_statement.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/msl/generator_impl.h"
|
||||
#include "src/writer/msl/test_helper.h"
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "src/ast/type/matrix_type.h"
|
||||
#include "src/ast/type/vector_type.h"
|
||||
#include "src/ast/type_constructor_expression.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/msl/generator_impl.h"
|
||||
#include "src/writer/msl/test_helper.h"
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include "src/ast/module.h"
|
||||
#include "src/ast/type/f32_type.h"
|
||||
#include "src/ast/type/vector_type.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/msl/generator_impl.h"
|
||||
#include "src/writer/msl/test_helper.h"
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "src/ast/intrinsic_texture_helper_test.h"
|
||||
#include "src/ast/type/depth_texture_type.h"
|
||||
#include "src/ast/type/sampled_texture_type.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/msl/generator_impl.h"
|
||||
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "src/ast/type/u32_type.h"
|
||||
#include "src/ast/type/vector_type.h"
|
||||
#include "src/ast/type/void_type.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/msl/generator_impl.h"
|
||||
#include "src/writer/msl/test_helper.h"
|
||||
|
|
|
@ -279,8 +279,6 @@ Builder::AccessorInfo::~AccessorInfo() {}
|
|||
|
||||
Builder::Builder(ast::Module* mod) : mod_(mod), scope_stack_({}) {}
|
||||
|
||||
Builder::Builder(Context*, ast::Module* mod) : Builder(mod) {}
|
||||
|
||||
Builder::~Builder() = default;
|
||||
|
||||
bool Builder::Build() {
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
#include "src/ast/type_constructor_expression.h"
|
||||
#include "src/ast/unary_op_expression.h"
|
||||
#include "src/ast/variable_decl_statement.h"
|
||||
#include "src/context.h"
|
||||
#include "src/scope_stack.h"
|
||||
#include "src/writer/spirv/function.h"
|
||||
#include "src/writer/spirv/instruction.h"
|
||||
|
@ -85,11 +84,6 @@ class Builder {
|
|||
/// Constructor
|
||||
/// @param mod the module to generate from
|
||||
explicit Builder(ast::Module* mod);
|
||||
/// Constructor
|
||||
/// DEPRECATED
|
||||
/// @param ctx the context, must be non-null
|
||||
/// @param mod the module to generate from
|
||||
Builder(Context* ctx, ast::Module* mod);
|
||||
~Builder();
|
||||
|
||||
/// Generates the SPIR-V instructions for the given module
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include "src/ast/type_constructor_expression.h"
|
||||
#include "src/ast/uint_literal.h"
|
||||
#include "src/ast/variable.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "src/ast/type/struct_type.h"
|
||||
#include "src/ast/type/vector_type.h"
|
||||
#include "src/ast/type_constructor_expression.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "src/ast/type/vector_type.h"
|
||||
#include "src/ast/type_constructor_expression.h"
|
||||
#include "src/ast/uint_literal.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "src/ast/scalar_constructor_expression.h"
|
||||
#include "src/ast/type/f32_type.h"
|
||||
#include "src/ast/type/u32_type.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include "src/ast/scalar_constructor_expression.h"
|
||||
#include "src/ast/type/f32_type.h"
|
||||
#include "src/ast/variable_decl_statement.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "src/ast/type/f32_type.h"
|
||||
#include "src/ast/type/i32_type.h"
|
||||
#include "src/ast/type/void_type.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include "src/ast/type/vector_type.h"
|
||||
#include "src/ast/type_constructor_expression.h"
|
||||
#include "src/ast/uint_literal.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
#include "gtest/gtest.h"
|
||||
#include "src/ast/discard_statement.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "src/ast/type/void_type.h"
|
||||
#include "src/ast/variable.h"
|
||||
#include "src/ast/workgroup_decoration.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include "src/ast/type/void_type.h"
|
||||
#include "src/ast/variable.h"
|
||||
#include "src/ast/variable_decl_statement.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
#include "src/ast/type_constructor_expression.h"
|
||||
#include "src/ast/variable.h"
|
||||
#include "src/ast/variable_decoration.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "src/ast/type_constructor_expression.h"
|
||||
#include "src/ast/variable.h"
|
||||
#include "src/ast/variable_decoration.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "src/ast/type/vector_type.h"
|
||||
#include "src/ast/type_constructor_expression.h"
|
||||
#include "src/ast/variable.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "src/ast/sint_literal.h"
|
||||
#include "src/ast/type/bool_type.h"
|
||||
#include "src/ast/type/i32_type.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include "src/ast/type_constructor_expression.h"
|
||||
#include "src/ast/uint_literal.h"
|
||||
#include "src/ast/variable.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "src/ast/intrinsic_texture_helper_test.h"
|
||||
#include "src/ast/type/depth_texture_type.h"
|
||||
#include "src/ast/type/sampled_texture_type.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "src/ast/scalar_constructor_expression.h"
|
||||
#include "src/ast/sint_literal.h"
|
||||
#include "src/ast/type/i32_type.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#include "src/ast/type/f32_type.h"
|
||||
#include "src/ast/type/vector_type.h"
|
||||
#include "src/ast/type_constructor_expression.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "src/ast/switch_statement.h"
|
||||
#include "src/ast/type/bool_type.h"
|
||||
#include "src/ast/type/i32_type.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "src/ast/type/i32_type.h"
|
||||
#include "src/ast/type/vector_type.h"
|
||||
#include "src/ast/unary_op_expression.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/spirv/builder.h"
|
||||
#include "src/writer/spirv/spv_dump.h"
|
||||
|
|
|
@ -25,9 +25,6 @@ Generator::Generator(ast::Module module)
|
|||
builder_(std::make_unique<Builder>(&module_)),
|
||||
writer_(std::make_unique<BinaryWriter>()) {}
|
||||
|
||||
Generator::Generator(Context*, ast::Module module)
|
||||
: Generator(std::move(module)) {}
|
||||
|
||||
Generator::~Generator() = default;
|
||||
|
||||
void Generator::Reset() {
|
||||
|
|
|
@ -34,11 +34,6 @@ class Generator : public writer::Writer {
|
|||
/// Constructor
|
||||
/// @param module the module to convert
|
||||
explicit Generator(ast::Module module);
|
||||
/// Constructor
|
||||
/// DEPRECATED
|
||||
/// @param ctx the context, must be non-null
|
||||
/// @param module the module to convert
|
||||
Generator(Context* ctx, ast::Module module);
|
||||
~Generator() override;
|
||||
|
||||
/// Resets the generator
|
||||
|
|
|
@ -23,9 +23,6 @@ namespace wgsl {
|
|||
Generator::Generator(ast::Module module)
|
||||
: Text(std::move(module)), impl_(std::make_unique<GeneratorImpl>()) {}
|
||||
|
||||
Generator::Generator(Context*, ast::Module module)
|
||||
: Generator(std::move(module)) {}
|
||||
|
||||
Generator::~Generator() = default;
|
||||
|
||||
void Generator::Reset() {
|
||||
|
|
|
@ -31,11 +31,6 @@ class Generator : public Text {
|
|||
/// Constructor
|
||||
/// @param module the module to convert
|
||||
explicit Generator(ast::Module module);
|
||||
/// Constructor
|
||||
/// DEPRECATED
|
||||
/// @param ctx the context, must be non-null
|
||||
/// @param module the module to convert
|
||||
Generator(Context* ctx, ast::Module module);
|
||||
~Generator() override;
|
||||
|
||||
/// Resets the generator
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include "src/ast/variable.h"
|
||||
#include "src/ast/variable_decl_statement.h"
|
||||
#include "src/ast/workgroup_decoration.h"
|
||||
#include "src/context.h"
|
||||
#include "src/type_determiner.h"
|
||||
#include "src/writer/wgsl/generator_impl.h"
|
||||
#include "src/writer/wgsl/test_helper.h"
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
#include "src/ast/module.h"
|
||||
#include "src/ast/pipeline_stage.h"
|
||||
#include "src/context.h"
|
||||
|
||||
namespace tint {
|
||||
namespace writer {
|
||||
|
|
Loading…
Reference in New Issue