Fixup lint errors.
This CL fixes up the various lint errors. Change-Id: If4d3077b55aadec33980452c43917194d803fac6 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/31680 Reviewed-by: Ben Clayton <bclayton@google.com> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
parent
de6938789c
commit
d5fd7e02ba
|
@ -60,8 +60,9 @@ def CheckChange(input_api, output_api):
|
||||||
results += input_api.canned_checks.CheckChangeHasNoStrayWhitespace(
|
results += input_api.canned_checks.CheckChangeHasNoStrayWhitespace(
|
||||||
input_api, output_api)
|
input_api, output_api)
|
||||||
results += input_api.canned_checks.CheckDoNotSubmit(input_api, output_api)
|
results += input_api.canned_checks.CheckDoNotSubmit(input_api, output_api)
|
||||||
results += input_api.canned_checks.CheckChangeLintsClean(
|
results += input_api.canned_checks.CheckChangeLintsClean(input_api,
|
||||||
input_api, output_api)
|
output_api,
|
||||||
|
lint_filters="")
|
||||||
results += input_api.canned_checks.CheckGenderNeutral(
|
results += input_api.canned_checks.CheckGenderNeutral(
|
||||||
input_api, output_api)
|
input_api, output_api)
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,8 @@
|
||||||
#include "spirv-tools/libspirv.hpp"
|
#include "spirv-tools/libspirv.hpp"
|
||||||
#endif // TINT_BUILD_SPV_READER
|
#endif // TINT_BUILD_SPV_READER
|
||||||
|
|
||||||
#include "tint/tint.h"
|
|
||||||
|
|
||||||
#include "src/diagnostic/printer.h"
|
#include "src/diagnostic/printer.h"
|
||||||
|
#include "tint/tint.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,7 @@ class BlockStatement : public Statement {
|
||||||
/// @param index the index to insert at
|
/// @param index the index to insert at
|
||||||
/// @param stmt the statement to insert
|
/// @param stmt the statement to insert
|
||||||
void insert(size_t index, std::unique_ptr<ast::Statement> stmt) {
|
void insert(size_t index, std::unique_ptr<ast::Statement> stmt) {
|
||||||
statements_.insert(statements_.begin() + static_cast<long>(index),
|
statements_.insert(statements_.begin() + index, std::move(stmt));
|
||||||
std::move(stmt));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @returns true if the block is empty
|
/// @returns true if the block is empty
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <tuple>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,8 @@ TEST_F(IfStatementTest, Creation_WithSource) {
|
||||||
auto body = std::make_unique<ast::BlockStatement>();
|
auto body = std::make_unique<ast::BlockStatement>();
|
||||||
body->append(std::make_unique<DiscardStatement>());
|
body->append(std::make_unique<DiscardStatement>());
|
||||||
|
|
||||||
IfStatement stmt(Source{Source::Location{20, 2}}, std::move(cond), std::move(body));
|
IfStatement stmt(Source{Source::Location{20, 2}}, std::move(cond),
|
||||||
|
std::move(body));
|
||||||
auto src = stmt.source();
|
auto src = stmt.source();
|
||||||
EXPECT_EQ(src.range.begin.line, 20u);
|
EXPECT_EQ(src.range.begin.line, 20u);
|
||||||
EXPECT_EQ(src.range.begin.column, 2u);
|
EXPECT_EQ(src.range.begin.column, 2u);
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#ifndef SRC_AST_LOOP_STATEMENT_H_
|
#ifndef SRC_AST_LOOP_STATEMENT_H_
|
||||||
#define SRC_AST_LOOP_STATEMENT_H_
|
#define SRC_AST_LOOP_STATEMENT_H_
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "src/ast/block_statement.h"
|
#include "src/ast/block_statement.h"
|
||||||
|
|
|
@ -51,7 +51,8 @@ TEST_F(SwitchStatementTest, Creation) {
|
||||||
TEST_F(SwitchStatementTest, Creation_WithSource) {
|
TEST_F(SwitchStatementTest, Creation_WithSource) {
|
||||||
auto ident = std::make_unique<IdentifierExpression>("ident");
|
auto ident = std::make_unique<IdentifierExpression>("ident");
|
||||||
|
|
||||||
SwitchStatement stmt(Source{Source::Location{20, 2}}, std::move(ident), CaseStatementList());
|
SwitchStatement stmt(Source{Source::Location{20, 2}}, std::move(ident),
|
||||||
|
CaseStatementList());
|
||||||
auto src = stmt.source();
|
auto src = stmt.source();
|
||||||
EXPECT_EQ(src.range.begin.line, 20u);
|
EXPECT_EQ(src.range.begin.line, 20u);
|
||||||
EXPECT_EQ(src.range.begin.column, 2u);
|
EXPECT_EQ(src.range.begin.column, 2u);
|
||||||
|
|
|
@ -15,9 +15,10 @@
|
||||||
#ifndef SRC_AST_TYPE_ACCESS_CONTROL_TYPE_H_
|
#ifndef SRC_AST_TYPE_ACCESS_CONTROL_TYPE_H_
|
||||||
#define SRC_AST_TYPE_ACCESS_CONTROL_TYPE_H_
|
#define SRC_AST_TYPE_ACCESS_CONTROL_TYPE_H_
|
||||||
|
|
||||||
#include "src/ast/type/type.h"
|
#include <string>
|
||||||
|
|
||||||
#include "src/ast/access_control.h"
|
#include "src/ast/access_control.h"
|
||||||
|
#include "src/ast/type/type.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
namespace ast {
|
namespace ast {
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "src/ast/array_decoration.h"
|
#include "src/ast/array_decoration.h"
|
||||||
#include "src/ast/type/type.h"
|
#include "src/ast/type/type.h"
|
||||||
|
|
|
@ -14,6 +14,9 @@
|
||||||
|
|
||||||
#include "src/ast/type/array_type.h"
|
#include "src/ast/type/array_type.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "src/ast/stride_decoration.h"
|
#include "src/ast/stride_decoration.h"
|
||||||
#include "src/ast/type/i32_type.h"
|
#include "src/ast/type/i32_type.h"
|
||||||
|
|
|
@ -14,10 +14,11 @@
|
||||||
|
|
||||||
#include "src/ast/type/storage_texture_type.h"
|
#include "src/ast/type/storage_texture_type.h"
|
||||||
|
|
||||||
#include "src/ast/identifier_expression.h"
|
#include <memory>
|
||||||
#include "src/type_determiner.h"
|
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
#include "src/ast/identifier_expression.h"
|
||||||
|
#include "src/type_determiner.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
namespace ast {
|
namespace ast {
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "src/diagnostic/formatter.h"
|
#include "src/diagnostic/formatter.h"
|
||||||
#include "src/diagnostic/diagnostic.h"
|
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
#include "src/diagnostic/diagnostic.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
namespace diag {
|
namespace diag {
|
||||||
|
|
|
@ -12,12 +12,12 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "src/diagnostic/printer.h"
|
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
#include "src/diagnostic/printer.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
namespace diag {
|
namespace diag {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
|
@ -12,10 +12,10 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "src/diagnostic/printer.h"
|
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
#include "src/diagnostic/printer.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
namespace diag {
|
namespace diag {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
|
@ -12,10 +12,10 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "src/diagnostic/printer.h"
|
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
#include "src/diagnostic/printer.h"
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN 1
|
#define WIN32_LEAN_AND_MEAN 1
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#ifndef SRC_INSPECTOR_ENTRY_POINT_H_
|
#ifndef SRC_INSPECTOR_ENTRY_POINT_H_
|
||||||
#define SRC_INSPECTOR_ENTRY_POINT_H_
|
#define SRC_INSPECTOR_ENTRY_POINT_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "src/ast/bool_literal.h"
|
#include "src/ast/bool_literal.h"
|
||||||
#include "src/ast/constructor_expression.h"
|
#include "src/ast/constructor_expression.h"
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
#include "src/inspector/inspector.h"
|
#include "src/inspector/inspector.h"
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "src/ast/assignment_statement.h"
|
#include "src/ast/assignment_statement.h"
|
||||||
#include "src/ast/bool_literal.h"
|
#include "src/ast/bool_literal.h"
|
||||||
|
@ -52,7 +54,6 @@
|
||||||
#include "src/ast/workgroup_decoration.h"
|
#include "src/ast/workgroup_decoration.h"
|
||||||
#include "src/context.h"
|
#include "src/context.h"
|
||||||
#include "src/type_determiner.h"
|
#include "src/type_determiner.h"
|
||||||
|
|
||||||
#include "tint/tint.h"
|
#include "tint/tint.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
|
|
|
@ -12,12 +12,11 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "src/reader/spirv/function.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "gmock/gmock.h"
|
#include "gmock/gmock.h"
|
||||||
|
#include "src/reader/spirv/function.h"
|
||||||
#include "src/reader/spirv/parser_impl.h"
|
#include "src/reader/spirv/parser_impl.h"
|
||||||
#include "src/reader/spirv/parser_impl_test_helper.h"
|
#include "src/reader/spirv/parser_impl_test_helper.h"
|
||||||
#include "src/reader/spirv/spirv_tools_helpers_test.h"
|
#include "src/reader/spirv/spirv_tools_helpers_test.h"
|
||||||
|
|
|
@ -643,7 +643,7 @@ TEST_F(SpvParserTest,
|
||||||
|
|
||||||
TEST_F(
|
TEST_F(
|
||||||
SpvParserTest,
|
SpvParserTest,
|
||||||
RegisterMerges_GoodLoopMerge_MultiBlockLoop_ContinueIsNotHeader_BranchConditional) {
|
RegisterMerges_GoodLoopMerge_MultiBlockLoop_ContinueIsNotHeader_BranchConditional) { // NOLINT
|
||||||
auto* p = parser(test::Assemble(CommonTypes() + R"(
|
auto* p = parser(test::Assemble(CommonTypes() + R"(
|
||||||
%100 = OpFunction %void None %voidfn
|
%100 = OpFunction %void None %voidfn
|
||||||
|
|
||||||
|
@ -4570,7 +4570,7 @@ TEST_F(SpvParserTest,
|
||||||
|
|
||||||
TEST_F(
|
TEST_F(
|
||||||
SpvParserTest,
|
SpvParserTest,
|
||||||
ClassifyCFGEdges_BackEdge_MultiBlockLoop_MultiBlockContinueConstruct_ContinueIsNotHeader) {
|
ClassifyCFGEdges_BackEdge_MultiBlockLoop_MultiBlockContinueConstruct_ContinueIsNotHeader) { // NOLINT
|
||||||
auto assembly = CommonTypes() + R"(
|
auto assembly = CommonTypes() + R"(
|
||||||
%100 = OpFunction %void None %voidfn
|
%100 = OpFunction %void None %voidfn
|
||||||
|
|
||||||
|
@ -4606,7 +4606,7 @@ TEST_F(
|
||||||
|
|
||||||
TEST_F(
|
TEST_F(
|
||||||
SpvParserTest,
|
SpvParserTest,
|
||||||
ClassifyCFGEdges_BackEdge_MultiBlockLoop_MultiBlockContinueConstruct_ContinueIsHeader) {
|
ClassifyCFGEdges_BackEdge_MultiBlockLoop_MultiBlockContinueConstruct_ContinueIsHeader) { // NOLINT
|
||||||
auto assembly = CommonTypes() + R"(
|
auto assembly = CommonTypes() + R"(
|
||||||
%100 = OpFunction %void None %voidfn
|
%100 = OpFunction %void None %voidfn
|
||||||
|
|
||||||
|
|
|
@ -1460,7 +1460,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_StorageBuffer_NonWritable_NotAllMembers) {
|
||||||
|
|
||||||
TEST_F(
|
TEST_F(
|
||||||
SpvParserTest,
|
SpvParserTest,
|
||||||
ModuleScopeVar_StorageBuffer_NonWritable_NotAllMembers_DuplicatedOnSameMember) {
|
ModuleScopeVar_StorageBuffer_NonWritable_NotAllMembers_DuplicatedOnSameMember) { // NOLINT
|
||||||
// Variable should have access(read_write)
|
// Variable should have access(read_write)
|
||||||
auto* p = parser(test::Assemble(R"(
|
auto* p = parser(test::Assemble(R"(
|
||||||
OpName %myvar "myvar"
|
OpName %myvar "myvar"
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
#include "src/reader/wgsl/parser.h"
|
#include "src/reader/wgsl/parser.h"
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "src/reader/wgsl/parser_impl.h"
|
#include "src/reader/wgsl/parser_impl.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
|
|
|
@ -12,12 +12,12 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "src/reader/wgsl/parser_impl.h"
|
#include "src/reader/wgsl/parser_impl.h"
|
||||||
#include "src/reader/wgsl/parser_impl_test_helper.h"
|
#include "src/reader/wgsl/parser_impl_test_helper.h"
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
namespace reader {
|
namespace reader {
|
||||||
namespace wgsl {
|
namespace wgsl {
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "src/context.h"
|
#include "src/context.h"
|
||||||
|
|
|
@ -12,9 +12,10 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include <sstream>
|
#include "src/source.h"
|
||||||
|
|
||||||
#include "source.h"
|
#include <sstream>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
|
@ -14,6 +14,9 @@
|
||||||
|
|
||||||
#include "src/transform/bound_array_accessors_transform.h"
|
#include "src/transform/bound_array_accessors_transform.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "src/ast/assignment_statement.h"
|
#include "src/ast/assignment_statement.h"
|
||||||
#include "src/ast/binary_expression.h"
|
#include "src/ast/binary_expression.h"
|
||||||
#include "src/ast/bitcast_expression.h"
|
#include "src/ast/bitcast_expression.h"
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#ifndef SRC_TRANSFORM_BOUND_ARRAY_ACCESSORS_TRANSFORM_H_
|
#ifndef SRC_TRANSFORM_BOUND_ARRAY_ACCESSORS_TRANSFORM_H_
|
||||||
#define SRC_TRANSFORM_BOUND_ARRAY_ACCESSORS_TRANSFORM_H_
|
#define SRC_TRANSFORM_BOUND_ARRAY_ACCESSORS_TRANSFORM_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "src/ast/array_accessor_expression.h"
|
#include "src/ast/array_accessor_expression.h"
|
||||||
#include "src/ast/expression.h"
|
#include "src/ast/expression.h"
|
||||||
#include "src/ast/module.h"
|
#include "src/ast/module.h"
|
||||||
|
@ -23,8 +25,6 @@
|
||||||
#include "src/scope_stack.h"
|
#include "src/scope_stack.h"
|
||||||
#include "src/transform/transformer.h"
|
#include "src/transform/transformer.h"
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
namespace transform {
|
namespace transform {
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "src/transform/bound_array_accessors_transform.h"
|
#include "src/transform/bound_array_accessors_transform.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "src/ast/array_accessor_expression.h"
|
#include "src/ast/array_accessor_expression.h"
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "src/transform/transformer.h"
|
#include "src/transform/transformer.h"
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
#include "src/transform/vertex_pulling_transform.h"
|
#include "src/transform/vertex_pulling_transform.h"
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "src/ast/array_accessor_expression.h"
|
#include "src/ast/array_accessor_expression.h"
|
||||||
#include "src/ast/assignment_statement.h"
|
#include "src/ast/assignment_statement.h"
|
||||||
#include "src/ast/binary_expression.h"
|
#include "src/ast/binary_expression.h"
|
||||||
|
|
|
@ -15,6 +15,11 @@
|
||||||
#ifndef SRC_TRANSFORM_VERTEX_PULLING_TRANSFORM_H_
|
#ifndef SRC_TRANSFORM_VERTEX_PULLING_TRANSFORM_H_
|
||||||
#define SRC_TRANSFORM_VERTEX_PULLING_TRANSFORM_H_
|
#define SRC_TRANSFORM_VERTEX_PULLING_TRANSFORM_H_
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "src/ast/expression.h"
|
#include "src/ast/expression.h"
|
||||||
#include "src/ast/function.h"
|
#include "src/ast/function.h"
|
||||||
#include "src/ast/module.h"
|
#include "src/ast/module.h"
|
||||||
|
@ -23,11 +28,6 @@
|
||||||
#include "src/context.h"
|
#include "src/context.h"
|
||||||
#include "src/transform/transformer.h"
|
#include "src/transform/transformer.h"
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
#include <unordered_map>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
namespace transform {
|
namespace transform {
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
#include "src/transform/vertex_pulling_transform.h"
|
#include "src/transform/vertex_pulling_transform.h"
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "src/ast/decorated_variable.h"
|
#include "src/ast/decorated_variable.h"
|
||||||
#include "src/ast/function.h"
|
#include "src/ast/function.h"
|
||||||
|
|
|
@ -552,8 +552,8 @@ bool TypeDeterminer::DetermineIntrinsic(ast::IdentifierExpression* ident,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (ast::intrinsic::IsTextureIntrinsic(ident->intrinsic())) {
|
if (ast::intrinsic::IsTextureIntrinsic(ident->intrinsic())) {
|
||||||
// TODO: Remove the LOD param from textureLoad on storage textures when
|
// TODO(dsinclair): Remove the LOD param from textureLoad on storage
|
||||||
// https://github.com/gpuweb/gpuweb/pull/1032 gets merged.
|
// textures when https://github.com/gpuweb/gpuweb/pull/1032 gets merged.
|
||||||
uint32_t num_of_params =
|
uint32_t num_of_params =
|
||||||
(ident->intrinsic() == ast::Intrinsic::kTextureLoad ||
|
(ident->intrinsic() == ast::Intrinsic::kTextureLoad ||
|
||||||
ident->intrinsic() == ast::Intrinsic::kTextureSample)
|
ident->intrinsic() == ast::Intrinsic::kTextureSample)
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "src/ast/module.h"
|
#include "src/ast/module.h"
|
||||||
#include "src/ast/type/storage_texture_type.h"
|
#include "src/ast/type/storage_texture_type.h"
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "src/validator.h"
|
#include "src/validator.h"
|
||||||
|
|
||||||
#include "src/validator_impl.h"
|
#include "src/validator_impl.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
|
|
|
@ -12,8 +12,6 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "src/validator_impl.h"
|
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "spirv/unified1/GLSL.std.450.h"
|
#include "spirv/unified1/GLSL.std.450.h"
|
||||||
#include "src/ast/case_statement.h"
|
#include "src/ast/case_statement.h"
|
||||||
|
@ -30,6 +28,7 @@
|
||||||
#include "src/ast/variable.h"
|
#include "src/ast/variable.h"
|
||||||
#include "src/ast/variable_decl_statement.h"
|
#include "src/ast/variable_decl_statement.h"
|
||||||
#include "src/type_determiner.h"
|
#include "src/type_determiner.h"
|
||||||
|
#include "src/validator_impl.h"
|
||||||
#include "src/validator_test_helper.h"
|
#include "src/validator_test_helper.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
|
|
|
@ -12,8 +12,6 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "src/validator_impl.h"
|
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "spirv/unified1/GLSL.std.450.h"
|
#include "spirv/unified1/GLSL.std.450.h"
|
||||||
#include "src/ast/call_statement.h"
|
#include "src/ast/call_statement.h"
|
||||||
|
@ -28,6 +26,7 @@
|
||||||
#include "src/ast/variable.h"
|
#include "src/ast/variable.h"
|
||||||
#include "src/ast/variable_decl_statement.h"
|
#include "src/ast/variable_decl_statement.h"
|
||||||
#include "src/type_determiner.h"
|
#include "src/type_determiner.h"
|
||||||
|
#include "src/validator_impl.h"
|
||||||
#include "src/validator_test_helper.h"
|
#include "src/validator_test_helper.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
|
|
|
@ -12,8 +12,6 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "src/validator_impl.h"
|
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "spirv/unified1/GLSL.std.450.h"
|
#include "spirv/unified1/GLSL.std.450.h"
|
||||||
#include "src/ast/array_accessor_expression.h"
|
#include "src/ast/array_accessor_expression.h"
|
||||||
|
@ -54,6 +52,7 @@
|
||||||
#include "src/ast/variable.h"
|
#include "src/ast/variable.h"
|
||||||
#include "src/ast/variable_decl_statement.h"
|
#include "src/ast/variable_decl_statement.h"
|
||||||
#include "src/type_determiner.h"
|
#include "src/type_determiner.h"
|
||||||
|
#include "src/validator_impl.h"
|
||||||
#include "src/validator_test_helper.h"
|
#include "src/validator_test_helper.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
|
|
|
@ -13,6 +13,9 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "src/validator_test_helper.h"
|
#include "src/validator_test_helper.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "src/type_manager.h"
|
#include "src/type_manager.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#ifndef SRC_VALIDATOR_TEST_HELPER_H_
|
#ifndef SRC_VALIDATOR_TEST_HELPER_H_
|
||||||
#define SRC_VALIDATOR_TEST_HELPER_H_
|
#define SRC_VALIDATOR_TEST_HELPER_H_
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "src/ast/type/void_type.h"
|
#include "src/ast/type/void_type.h"
|
||||||
#include "src/type_determiner.h"
|
#include "src/type_determiner.h"
|
||||||
#include "src/validator_impl.h"
|
#include "src/validator_impl.h"
|
||||||
|
|
|
@ -14,7 +14,10 @@
|
||||||
|
|
||||||
#include "src/writer/hlsl/generator_impl.h"
|
#include "src/writer/hlsl/generator_impl.h"
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "src/ast/array_accessor_expression.h"
|
#include "src/ast/array_accessor_expression.h"
|
||||||
#include "src/ast/assignment_statement.h"
|
#include "src/ast/assignment_statement.h"
|
||||||
|
|
|
@ -15,6 +15,9 @@
|
||||||
#ifndef SRC_WRITER_HLSL_GENERATOR_IMPL_H_
|
#ifndef SRC_WRITER_HLSL_GENERATOR_IMPL_H_
|
||||||
#define SRC_WRITER_HLSL_GENERATOR_IMPL_H_
|
#define SRC_WRITER_HLSL_GENERATOR_IMPL_H_
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <unordered_map>
|
||||||
|
|
||||||
#include "src/ast/intrinsic.h"
|
#include "src/ast/intrinsic.h"
|
||||||
#include "src/ast/literal.h"
|
#include "src/ast/literal.h"
|
||||||
#include "src/ast/module.h"
|
#include "src/ast/module.h"
|
||||||
|
|
|
@ -65,7 +65,8 @@ TEST_F(HlslGeneratorImplTest_Constructor, EmitConstructor_UInt) {
|
||||||
TEST_F(HlslGeneratorImplTest_Constructor, EmitConstructor_Float) {
|
TEST_F(HlslGeneratorImplTest_Constructor, EmitConstructor_Float) {
|
||||||
ast::type::F32Type f32;
|
ast::type::F32Type f32;
|
||||||
// Use a number close to 1<<30 but whose decimal representation ends in 0.
|
// Use a number close to 1<<30 but whose decimal representation ends in 0.
|
||||||
auto lit = std::make_unique<ast::FloatLiteral>(&f32, float((1 << 30) - 4));
|
auto lit = std::make_unique<ast::FloatLiteral>(
|
||||||
|
&f32, static_cast<float>((1 << 30) - 4));
|
||||||
ast::ScalarConstructorExpression expr(std::move(lit));
|
ast::ScalarConstructorExpression expr(std::move(lit));
|
||||||
|
|
||||||
ASSERT_TRUE(gen().EmitConstructor(pre(), out(), &expr)) << gen().error();
|
ASSERT_TRUE(gen().EmitConstructor(pre(), out(), &expr)) << gen().error();
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "src/ast/assignment_statement.h"
|
#include "src/ast/assignment_statement.h"
|
||||||
#include "src/ast/decorated_variable.h"
|
#include "src/ast/decorated_variable.h"
|
||||||
#include "src/ast/identifier_expression.h"
|
#include "src/ast/identifier_expression.h"
|
||||||
|
@ -30,8 +32,6 @@
|
||||||
#include "src/type_determiner.h"
|
#include "src/type_determiner.h"
|
||||||
#include "src/writer/hlsl/test_helper.h"
|
#include "src/writer/hlsl/test_helper.h"
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
namespace writer {
|
namespace writer {
|
||||||
namespace hlsl {
|
namespace hlsl {
|
||||||
|
|
|
@ -564,7 +564,7 @@ void frag_main() {
|
||||||
|
|
||||||
TEST_F(
|
TEST_F(
|
||||||
HlslGeneratorImplTest_Function,
|
HlslGeneratorImplTest_Function,
|
||||||
Emit_FunctionDecoration_Called_By_EntryPoints_WithLocationGlobals_And_Params) {
|
Emit_FunctionDecoration_Called_By_EntryPoints_WithLocationGlobals_And_Params) { // NOLINT
|
||||||
ast::type::VoidType void_type;
|
ast::type::VoidType void_type;
|
||||||
ast::type::F32Type f32;
|
ast::type::F32Type f32;
|
||||||
|
|
||||||
|
@ -731,7 +731,7 @@ ep_1_out ep_1() {
|
||||||
|
|
||||||
TEST_F(
|
TEST_F(
|
||||||
HlslGeneratorImplTest_Function,
|
HlslGeneratorImplTest_Function,
|
||||||
Emit_FunctionDecoration_Called_By_EntryPoints_WithBuiltinGlobals_And_Params) {
|
Emit_FunctionDecoration_Called_By_EntryPoints_WithBuiltinGlobals_And_Params) { // NOLINT
|
||||||
ast::type::VoidType void_type;
|
ast::type::VoidType void_type;
|
||||||
ast::type::F32Type f32;
|
ast::type::F32Type f32;
|
||||||
ast::type::VectorType vec4(&f32, 4);
|
ast::type::VectorType vec4(&f32, 4);
|
||||||
|
|
|
@ -1041,7 +1041,7 @@ TEST_F(HlslGeneratorImplTest_MemberAccessor,
|
||||||
|
|
||||||
TEST_F(
|
TEST_F(
|
||||||
HlslGeneratorImplTest_MemberAccessor,
|
HlslGeneratorImplTest_MemberAccessor,
|
||||||
EmitExpression_MemberAccessor_StorageBuffer_Load_MultiLevel_Swizzle_SingleLetter) {
|
EmitExpression_MemberAccessor_StorageBuffer_Load_MultiLevel_Swizzle_SingleLetter) { // NOLINT
|
||||||
// struct Data {
|
// struct Data {
|
||||||
// [[offset(0)]] a : vec3<i32>;
|
// [[offset(0)]] a : vec3<i32>;
|
||||||
// [[offset(16)]] b : vec3<f32>;
|
// [[offset(16)]] b : vec3<f32>;
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "src/writer/hlsl/namer.h"
|
#include "src/writer/hlsl/namer.h"
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#define SRC_WRITER_HLSL_TEST_HELPER_H_
|
#define SRC_WRITER_HLSL_TEST_HELPER_H_
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "src/ast/module.h"
|
#include "src/ast/module.h"
|
||||||
|
|
|
@ -14,6 +14,11 @@
|
||||||
|
|
||||||
#include "src/writer/msl/generator_impl.h"
|
#include "src/writer/msl/generator_impl.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <limits>
|
||||||
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "src/ast/array_accessor_expression.h"
|
#include "src/ast/array_accessor_expression.h"
|
||||||
#include "src/ast/assignment_statement.h"
|
#include "src/ast/assignment_statement.h"
|
||||||
#include "src/ast/binary_expression.h"
|
#include "src/ast/binary_expression.h"
|
||||||
|
|
|
@ -72,7 +72,8 @@ TEST_F(MslGeneratorImplTest, EmitConstructor_UInt) {
|
||||||
TEST_F(MslGeneratorImplTest, EmitConstructor_Float) {
|
TEST_F(MslGeneratorImplTest, EmitConstructor_Float) {
|
||||||
ast::type::F32Type f32;
|
ast::type::F32Type f32;
|
||||||
// Use a number close to 1<<30 but whose decimal representation ends in 0.
|
// Use a number close to 1<<30 but whose decimal representation ends in 0.
|
||||||
auto lit = std::make_unique<ast::FloatLiteral>(&f32, float((1 << 30) - 4));
|
auto lit = std::make_unique<ast::FloatLiteral>(
|
||||||
|
&f32, static_cast<float>((1 << 30) - 4));
|
||||||
ast::ScalarConstructorExpression expr(std::move(lit));
|
ast::ScalarConstructorExpression expr(std::move(lit));
|
||||||
|
|
||||||
ast::Module m;
|
ast::Module m;
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "src/ast/assignment_statement.h"
|
#include "src/ast/assignment_statement.h"
|
||||||
#include "src/ast/decorated_variable.h"
|
#include "src/ast/decorated_variable.h"
|
||||||
|
@ -30,8 +32,6 @@
|
||||||
#include "src/type_determiner.h"
|
#include "src/type_determiner.h"
|
||||||
#include "src/writer/msl/generator_impl.h"
|
#include "src/writer/msl/generator_impl.h"
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
namespace writer {
|
namespace writer {
|
||||||
namespace msl {
|
namespace msl {
|
||||||
|
|
|
@ -485,7 +485,7 @@ fragment void frag_main(const device Data& coord [[buffer(0)]]) {
|
||||||
|
|
||||||
TEST_F(
|
TEST_F(
|
||||||
MslGeneratorImplTest,
|
MslGeneratorImplTest,
|
||||||
Emit_FunctionDecoration_Called_By_EntryPoints_WithLocationGlobals_And_Params) {
|
Emit_FunctionDecoration_Called_By_EntryPoints_WithLocationGlobals_And_Params) { // NOLINT
|
||||||
ast::type::VoidType void_type;
|
ast::type::VoidType void_type;
|
||||||
ast::type::F32Type f32;
|
ast::type::F32Type f32;
|
||||||
|
|
||||||
|
@ -666,7 +666,7 @@ fragment ep_1_out ep_1() {
|
||||||
|
|
||||||
TEST_F(
|
TEST_F(
|
||||||
MslGeneratorImplTest,
|
MslGeneratorImplTest,
|
||||||
Emit_FunctionDecoration_Called_By_EntryPoints_WithBuiltinGlobals_And_Params) {
|
Emit_FunctionDecoration_Called_By_EntryPoints_WithBuiltinGlobals_And_Params) { // NOLINT
|
||||||
ast::type::VoidType void_type;
|
ast::type::VoidType void_type;
|
||||||
ast::type::F32Type f32;
|
ast::type::F32Type f32;
|
||||||
ast::type::VectorType vec4(&f32, 4);
|
ast::type::VectorType vec4(&f32, 4);
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "src/writer/msl/generator_impl.h"
|
#include "src/writer/msl/generator_impl.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "src/ast/function.h"
|
#include "src/ast/function.h"
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "src/writer/msl/namer.h"
|
#include "src/writer/msl/namer.h"
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include "src/writer/spirv/builder.h"
|
#include "src/writer/spirv/builder.h"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
@ -69,8 +70,6 @@
|
||||||
#include "src/ast/unary_op_expression.h"
|
#include "src/ast/unary_op_expression.h"
|
||||||
#include "src/ast/variable_decl_statement.h"
|
#include "src/ast/variable_decl_statement.h"
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
namespace writer {
|
namespace writer {
|
||||||
namespace spirv {
|
namespace spirv {
|
||||||
|
@ -1866,8 +1865,8 @@ uint32_t Builder::GenerateTextureIntrinsic(ast::IdentifierExpression* ident,
|
||||||
auto* texture_type =
|
auto* texture_type =
|
||||||
call->params()[0].get()->result_type()->UnwrapAll()->AsTexture();
|
call->params()[0].get()->result_type()->UnwrapAll()->AsTexture();
|
||||||
|
|
||||||
// TODO: Remove the LOD param from textureLoad on storage textures when
|
// TODO(dsinclair): Remove the LOD param from textureLoad on storage textures
|
||||||
// https://github.com/gpuweb/gpuweb/pull/1032 gets merged.
|
// when https://github.com/gpuweb/gpuweb/pull/1032 gets merged.
|
||||||
if (ident->intrinsic() == ast::Intrinsic::kTextureLoad) {
|
if (ident->intrinsic() == ast::Intrinsic::kTextureLoad) {
|
||||||
std::vector<Operand> spirv_params = {
|
std::vector<Operand> spirv_params = {
|
||||||
std::move(wgsl_params[0]), std::move(wgsl_params[1]),
|
std::move(wgsl_params[0]), std::move(wgsl_params[1]),
|
||||||
|
|
|
@ -74,7 +74,7 @@ TEST_P(FunctionDecoration_StageTest, Emit) {
|
||||||
ASSERT_TRUE(b.GenerateFunction(&func)) << b.error();
|
ASSERT_TRUE(b.GenerateFunction(&func)) << b.error();
|
||||||
|
|
||||||
auto preamble = b.entry_points();
|
auto preamble = b.entry_points();
|
||||||
ASSERT_TRUE(preamble.size() >= 1u);
|
ASSERT_GE(preamble.size(), 1u);
|
||||||
EXPECT_EQ(preamble[0].opcode(), spv::Op::OpEntryPoint);
|
EXPECT_EQ(preamble[0].opcode(), spv::Op::OpEntryPoint);
|
||||||
|
|
||||||
ASSERT_GE(preamble[0].operands().size(), 3u);
|
ASSERT_GE(preamble[0].operands().size(), 3u);
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#define SRC_WRITER_SPIRV_GENERATOR_H_
|
#define SRC_WRITER_SPIRV_GENERATOR_H_
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "src/ast/module.h"
|
#include "src/ast/module.h"
|
||||||
|
|
|
@ -67,7 +67,8 @@ TEST_F(WgslGeneratorImplTest, EmitConstructor_UInt) {
|
||||||
TEST_F(WgslGeneratorImplTest, EmitConstructor_Float) {
|
TEST_F(WgslGeneratorImplTest, EmitConstructor_Float) {
|
||||||
ast::type::F32Type f32;
|
ast::type::F32Type f32;
|
||||||
// Use a number close to 1<<30 but whose decimal representation ends in 0.
|
// Use a number close to 1<<30 but whose decimal representation ends in 0.
|
||||||
auto lit = std::make_unique<ast::FloatLiteral>(&f32, float((1 << 30) - 4));
|
auto lit = std::make_unique<ast::FloatLiteral>(
|
||||||
|
&f32, static_cast<float>((1 << 30) - 4));
|
||||||
ast::ScalarConstructorExpression expr(std::move(lit));
|
ast::ScalarConstructorExpression expr(std::move(lit));
|
||||||
|
|
||||||
GeneratorImpl g;
|
GeneratorImpl g;
|
||||||
|
|
|
@ -15,5 +15,6 @@
|
||||||
|
|
||||||
set -e # fail on error
|
set -e # fail on error
|
||||||
|
|
||||||
./third_party/cpplint/cpplint/cpplint.py --root=. `find src -type f`
|
FILTER="-runtime/references"
|
||||||
./third_party/cpplint/cpplint/cpplint.py --root=. `find samples -type f`
|
./third_party/cpplint/cpplint/cpplint.py --root=. --filter="$FILTER" `find src -type f`
|
||||||
|
./third_party/cpplint/cpplint/cpplint.py --root=. --filter="$FILTER" `find samples -type f`
|
||||||
|
|
Loading…
Reference in New Issue