diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 5d57660010..cfff527013 100755 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -60,8 +60,9 @@ def CheckChange(input_api, output_api): results += input_api.canned_checks.CheckChangeHasNoStrayWhitespace( input_api, output_api) results += input_api.canned_checks.CheckDoNotSubmit(input_api, output_api) - results += input_api.canned_checks.CheckChangeLintsClean( - input_api, output_api) + results += input_api.canned_checks.CheckChangeLintsClean(input_api, + output_api, + lint_filters="") results += input_api.canned_checks.CheckGenderNeutral( input_api, output_api) diff --git a/samples/main.cc b/samples/main.cc index b42a0eda52..5494ef1d31 100644 --- a/samples/main.cc +++ b/samples/main.cc @@ -24,9 +24,8 @@ #include "spirv-tools/libspirv.hpp" #endif // TINT_BUILD_SPV_READER -#include "tint/tint.h" - #include "src/diagnostic/printer.h" +#include "tint/tint.h" namespace { diff --git a/src/ast/block_statement.h b/src/ast/block_statement.h index 5962867f2d..3c2a26874e 100644 --- a/src/ast/block_statement.h +++ b/src/ast/block_statement.h @@ -46,8 +46,7 @@ class BlockStatement : public Statement { /// @param index the index to insert at /// @param stmt the statement to insert void insert(size_t index, std::unique_ptr stmt) { - statements_.insert(statements_.begin() + static_cast(index), - std::move(stmt)); + statements_.insert(statements_.begin() + index, std::move(stmt)); } /// @returns true if the block is empty diff --git a/src/ast/function.h b/src/ast/function.h index 25bb059a6d..52cff4909c 100644 --- a/src/ast/function.h +++ b/src/ast/function.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include diff --git a/src/ast/if_statement_test.cc b/src/ast/if_statement_test.cc index 2e3db8712e..67597ea1d3 100644 --- a/src/ast/if_statement_test.cc +++ b/src/ast/if_statement_test.cc @@ -43,7 +43,8 @@ TEST_F(IfStatementTest, Creation_WithSource) { auto body = std::make_unique(); body->append(std::make_unique()); - 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(); EXPECT_EQ(src.range.begin.line, 20u); EXPECT_EQ(src.range.begin.column, 2u); diff --git a/src/ast/loop_statement.h b/src/ast/loop_statement.h index edb2381187..919eb06621 100644 --- a/src/ast/loop_statement.h +++ b/src/ast/loop_statement.h @@ -15,6 +15,7 @@ #ifndef SRC_AST_LOOP_STATEMENT_H_ #define SRC_AST_LOOP_STATEMENT_H_ +#include #include #include "src/ast/block_statement.h" diff --git a/src/ast/switch_statement_test.cc b/src/ast/switch_statement_test.cc index b37c07a04d..52774c65e6 100644 --- a/src/ast/switch_statement_test.cc +++ b/src/ast/switch_statement_test.cc @@ -51,7 +51,8 @@ TEST_F(SwitchStatementTest, Creation) { TEST_F(SwitchStatementTest, Creation_WithSource) { auto ident = std::make_unique("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(); EXPECT_EQ(src.range.begin.line, 20u); EXPECT_EQ(src.range.begin.column, 2u); diff --git a/src/ast/type/access_control_type.h b/src/ast/type/access_control_type.h index cf802b6cfa..146a80aa77 100644 --- a/src/ast/type/access_control_type.h +++ b/src/ast/type/access_control_type.h @@ -15,9 +15,10 @@ #ifndef SRC_AST_TYPE_ACCESS_CONTROL_TYPE_H_ #define SRC_AST_TYPE_ACCESS_CONTROL_TYPE_H_ -#include "src/ast/type/type.h" +#include #include "src/ast/access_control.h" +#include "src/ast/type/type.h" namespace tint { namespace ast { diff --git a/src/ast/type/array_type.h b/src/ast/type/array_type.h index fceca8e022..aaea0585ed 100644 --- a/src/ast/type/array_type.h +++ b/src/ast/type/array_type.h @@ -18,6 +18,7 @@ #include #include +#include #include "src/ast/array_decoration.h" #include "src/ast/type/type.h" diff --git a/src/ast/type/array_type_test.cc b/src/ast/type/array_type_test.cc index 71b4343983..2f128a4a75 100644 --- a/src/ast/type/array_type_test.cc +++ b/src/ast/type/array_type_test.cc @@ -14,6 +14,9 @@ #include "src/ast/type/array_type.h" +#include +#include + #include "gtest/gtest.h" #include "src/ast/stride_decoration.h" #include "src/ast/type/i32_type.h" diff --git a/src/ast/type/storage_texture_type_test.cc b/src/ast/type/storage_texture_type_test.cc index da4f501d3e..cc0679f424 100644 --- a/src/ast/type/storage_texture_type_test.cc +++ b/src/ast/type/storage_texture_type_test.cc @@ -14,10 +14,11 @@ #include "src/ast/type/storage_texture_type.h" -#include "src/ast/identifier_expression.h" -#include "src/type_determiner.h" +#include #include "gtest/gtest.h" +#include "src/ast/identifier_expression.h" +#include "src/type_determiner.h" namespace tint { namespace ast { diff --git a/src/diagnostic/formatter_test.cc b/src/diagnostic/formatter_test.cc index 69654a24f1..582557baee 100644 --- a/src/diagnostic/formatter_test.cc +++ b/src/diagnostic/formatter_test.cc @@ -13,9 +13,9 @@ // limitations under the License. #include "src/diagnostic/formatter.h" -#include "src/diagnostic/diagnostic.h" #include "gtest/gtest.h" +#include "src/diagnostic/diagnostic.h" namespace tint { namespace diag { diff --git a/src/diagnostic/printer_linux.cc b/src/diagnostic/printer_linux.cc index 840b13355d..99b0da49a8 100644 --- a/src/diagnostic/printer_linux.cc +++ b/src/diagnostic/printer_linux.cc @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "src/diagnostic/printer.h" - #include #include +#include "src/diagnostic/printer.h" + namespace tint { namespace diag { namespace { diff --git a/src/diagnostic/printer_other.cc b/src/diagnostic/printer_other.cc index 8d15c380ef..bde534a950 100644 --- a/src/diagnostic/printer_other.cc +++ b/src/diagnostic/printer_other.cc @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "src/diagnostic/printer.h" - #include +#include "src/diagnostic/printer.h" + namespace tint { namespace diag { namespace { diff --git a/src/diagnostic/printer_windows.cc b/src/diagnostic/printer_windows.cc index efcd60d72e..504ca9b60e 100644 --- a/src/diagnostic/printer_windows.cc +++ b/src/diagnostic/printer_windows.cc @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "src/diagnostic/printer.h" - #include +#include "src/diagnostic/printer.h" + #define WIN32_LEAN_AND_MEAN 1 #include diff --git a/src/inspector/entry_point.h b/src/inspector/entry_point.h index 8c3bd73175..137f41a92c 100644 --- a/src/inspector/entry_point.h +++ b/src/inspector/entry_point.h @@ -15,6 +15,7 @@ #ifndef SRC_INSPECTOR_ENTRY_POINT_H_ #define SRC_INSPECTOR_ENTRY_POINT_H_ +#include #include #include diff --git a/src/inspector/inspector.cc b/src/inspector/inspector.cc index 9a5e90add3..39b9e5963c 100644 --- a/src/inspector/inspector.cc +++ b/src/inspector/inspector.cc @@ -16,6 +16,7 @@ #include #include +#include #include "src/ast/bool_literal.h" #include "src/ast/constructor_expression.h" diff --git a/src/inspector/inspector_test.cc b/src/inspector/inspector_test.cc index dbdaf934f8..e6215576e4 100644 --- a/src/inspector/inspector_test.cc +++ b/src/inspector/inspector_test.cc @@ -14,6 +14,8 @@ #include "src/inspector/inspector.h" +#include + #include "gtest/gtest.h" #include "src/ast/assignment_statement.h" #include "src/ast/bool_literal.h" @@ -52,7 +54,6 @@ #include "src/ast/workgroup_decoration.h" #include "src/context.h" #include "src/type_determiner.h" - #include "tint/tint.h" namespace tint { diff --git a/src/reader/spirv/function_call_test.cc b/src/reader/spirv/function_call_test.cc index 934bb5c0c2..e2ab0993eb 100644 --- a/src/reader/spirv/function_call_test.cc +++ b/src/reader/spirv/function_call_test.cc @@ -12,12 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "src/reader/spirv/function.h" - #include #include #include "gmock/gmock.h" +#include "src/reader/spirv/function.h" #include "src/reader/spirv/parser_impl.h" #include "src/reader/spirv/parser_impl_test_helper.h" #include "src/reader/spirv/spirv_tools_helpers_test.h" diff --git a/src/reader/spirv/function_cfg_test.cc b/src/reader/spirv/function_cfg_test.cc index 0a2db84a01..ea3b0a1d32 100644 --- a/src/reader/spirv/function_cfg_test.cc +++ b/src/reader/spirv/function_cfg_test.cc @@ -643,7 +643,7 @@ TEST_F(SpvParserTest, TEST_F( SpvParserTest, - RegisterMerges_GoodLoopMerge_MultiBlockLoop_ContinueIsNotHeader_BranchConditional) { + RegisterMerges_GoodLoopMerge_MultiBlockLoop_ContinueIsNotHeader_BranchConditional) { // NOLINT auto* p = parser(test::Assemble(CommonTypes() + R"( %100 = OpFunction %void None %voidfn @@ -4570,7 +4570,7 @@ TEST_F(SpvParserTest, TEST_F( SpvParserTest, - ClassifyCFGEdges_BackEdge_MultiBlockLoop_MultiBlockContinueConstruct_ContinueIsNotHeader) { + ClassifyCFGEdges_BackEdge_MultiBlockLoop_MultiBlockContinueConstruct_ContinueIsNotHeader) { // NOLINT auto assembly = CommonTypes() + R"( %100 = OpFunction %void None %voidfn @@ -4606,7 +4606,7 @@ TEST_F( TEST_F( SpvParserTest, - ClassifyCFGEdges_BackEdge_MultiBlockLoop_MultiBlockContinueConstruct_ContinueIsHeader) { + ClassifyCFGEdges_BackEdge_MultiBlockLoop_MultiBlockContinueConstruct_ContinueIsHeader) { // NOLINT auto assembly = CommonTypes() + R"( %100 = OpFunction %void None %voidfn diff --git a/src/reader/spirv/parser_impl_module_var_test.cc b/src/reader/spirv/parser_impl_module_var_test.cc index f829ffff9a..3f6fe8e41d 100644 --- a/src/reader/spirv/parser_impl_module_var_test.cc +++ b/src/reader/spirv/parser_impl_module_var_test.cc @@ -1460,7 +1460,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_StorageBuffer_NonWritable_NotAllMembers) { TEST_F( SpvParserTest, - ModuleScopeVar_StorageBuffer_NonWritable_NotAllMembers_DuplicatedOnSameMember) { + ModuleScopeVar_StorageBuffer_NonWritable_NotAllMembers_DuplicatedOnSameMember) { // NOLINT // Variable should have access(read_write) auto* p = parser(test::Assemble(R"( OpName %myvar "myvar" diff --git a/src/reader/wgsl/parser.cc b/src/reader/wgsl/parser.cc index 0227e7e190..3b41c094bd 100644 --- a/src/reader/wgsl/parser.cc +++ b/src/reader/wgsl/parser.cc @@ -14,6 +14,8 @@ #include "src/reader/wgsl/parser.h" +#include + #include "src/reader/wgsl/parser_impl.h" namespace tint { diff --git a/src/reader/wgsl/parser_impl_for_stmt_test.cc b/src/reader/wgsl/parser_impl_for_stmt_test.cc index 44704b4cfa..f0b2435978 100644 --- a/src/reader/wgsl/parser_impl_for_stmt_test.cc +++ b/src/reader/wgsl/parser_impl_for_stmt_test.cc @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "gtest/gtest.h" #include "src/reader/wgsl/parser_impl.h" #include "src/reader/wgsl/parser_impl_test_helper.h" -#include - namespace tint { namespace reader { namespace wgsl { diff --git a/src/reader/wgsl/parser_impl_test_helper.h b/src/reader/wgsl/parser_impl_test_helper.h index cbefc11641..d8d5652aa6 100644 --- a/src/reader/wgsl/parser_impl_test_helper.h +++ b/src/reader/wgsl/parser_impl_test_helper.h @@ -17,6 +17,8 @@ #include #include +#include +#include #include "gtest/gtest.h" #include "src/context.h" diff --git a/src/source.cc b/src/source.cc index d14845315c..bd45fd5c34 100644 --- a/src/source.cc +++ b/src/source.cc @@ -12,9 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include +#include "src/source.h" -#include "source.h" +#include +#include namespace tint { namespace { diff --git a/src/transform/bound_array_accessors_transform.cc b/src/transform/bound_array_accessors_transform.cc index f0f698575f..78f139e232 100644 --- a/src/transform/bound_array_accessors_transform.cc +++ b/src/transform/bound_array_accessors_transform.cc @@ -14,6 +14,9 @@ #include "src/transform/bound_array_accessors_transform.h" +#include +#include + #include "src/ast/assignment_statement.h" #include "src/ast/binary_expression.h" #include "src/ast/bitcast_expression.h" diff --git a/src/transform/bound_array_accessors_transform.h b/src/transform/bound_array_accessors_transform.h index 5fe2fbbc3e..f67834b6f9 100644 --- a/src/transform/bound_array_accessors_transform.h +++ b/src/transform/bound_array_accessors_transform.h @@ -15,6 +15,8 @@ #ifndef SRC_TRANSFORM_BOUND_ARRAY_ACCESSORS_TRANSFORM_H_ #define SRC_TRANSFORM_BOUND_ARRAY_ACCESSORS_TRANSFORM_H_ +#include + #include "src/ast/array_accessor_expression.h" #include "src/ast/expression.h" #include "src/ast/module.h" @@ -23,8 +25,6 @@ #include "src/scope_stack.h" #include "src/transform/transformer.h" -#include - namespace tint { namespace transform { diff --git a/src/transform/bound_array_accessors_transform_test.cc b/src/transform/bound_array_accessors_transform_test.cc index b235a14433..cf013a7927 100644 --- a/src/transform/bound_array_accessors_transform_test.cc +++ b/src/transform/bound_array_accessors_transform_test.cc @@ -15,6 +15,7 @@ #include "src/transform/bound_array_accessors_transform.h" #include +#include #include "gtest/gtest.h" #include "src/ast/array_accessor_expression.h" diff --git a/src/transform/manager.h b/src/transform/manager.h index 538e4cfe5f..2848ec9a57 100644 --- a/src/transform/manager.h +++ b/src/transform/manager.h @@ -17,6 +17,8 @@ #include #include +#include +#include #include "src/transform/transformer.h" diff --git a/src/transform/vertex_pulling_transform.cc b/src/transform/vertex_pulling_transform.cc index 45fe5d3e29..3ab074d362 100644 --- a/src/transform/vertex_pulling_transform.cc +++ b/src/transform/vertex_pulling_transform.cc @@ -14,6 +14,8 @@ #include "src/transform/vertex_pulling_transform.h" +#include + #include "src/ast/array_accessor_expression.h" #include "src/ast/assignment_statement.h" #include "src/ast/binary_expression.h" diff --git a/src/transform/vertex_pulling_transform.h b/src/transform/vertex_pulling_transform.h index 805f7514ed..16eace9145 100644 --- a/src/transform/vertex_pulling_transform.h +++ b/src/transform/vertex_pulling_transform.h @@ -15,6 +15,11 @@ #ifndef SRC_TRANSFORM_VERTEX_PULLING_TRANSFORM_H_ #define SRC_TRANSFORM_VERTEX_PULLING_TRANSFORM_H_ +#include +#include +#include +#include + #include "src/ast/expression.h" #include "src/ast/function.h" #include "src/ast/module.h" @@ -23,11 +28,6 @@ #include "src/context.h" #include "src/transform/transformer.h" -#include -#include -#include -#include - namespace tint { namespace transform { diff --git a/src/transform/vertex_pulling_transform_test.cc b/src/transform/vertex_pulling_transform_test.cc index 3b71cd7c8f..9d13b980d9 100644 --- a/src/transform/vertex_pulling_transform_test.cc +++ b/src/transform/vertex_pulling_transform_test.cc @@ -14,6 +14,8 @@ #include "src/transform/vertex_pulling_transform.h" +#include + #include "gtest/gtest.h" #include "src/ast/decorated_variable.h" #include "src/ast/function.h" diff --git a/src/type_determiner.cc b/src/type_determiner.cc index 0e5656daaf..6a8532a7cb 100644 --- a/src/type_determiner.cc +++ b/src/type_determiner.cc @@ -552,8 +552,8 @@ bool TypeDeterminer::DetermineIntrinsic(ast::IdentifierExpression* ident, return true; } if (ast::intrinsic::IsTextureIntrinsic(ident->intrinsic())) { - // TODO: Remove the LOD param from textureLoad on storage textures when - // https://github.com/gpuweb/gpuweb/pull/1032 gets merged. + // TODO(dsinclair): Remove the LOD param from textureLoad on storage + // textures when https://github.com/gpuweb/gpuweb/pull/1032 gets merged. uint32_t num_of_params = (ident->intrinsic() == ast::Intrinsic::kTextureLoad || ident->intrinsic() == ast::Intrinsic::kTextureSample) diff --git a/src/type_determiner.h b/src/type_determiner.h index 30fc548d84..1384028c67 100644 --- a/src/type_determiner.h +++ b/src/type_determiner.h @@ -17,6 +17,7 @@ #include #include +#include #include "src/ast/module.h" #include "src/ast/type/storage_texture_type.h" diff --git a/src/validator.cc b/src/validator.cc index 3186d9e07d..5af8414e52 100644 --- a/src/validator.cc +++ b/src/validator.cc @@ -13,6 +13,7 @@ // limitations under the License. #include "src/validator.h" + #include "src/validator_impl.h" namespace tint { diff --git a/src/validator_control_block_test.cc b/src/validator_control_block_test.cc index 1489ce5844..9baa0f0f42 100644 --- a/src/validator_control_block_test.cc +++ b/src/validator_control_block_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "src/validator_impl.h" - #include "gtest/gtest.h" #include "spirv/unified1/GLSL.std.450.h" #include "src/ast/case_statement.h" @@ -30,6 +28,7 @@ #include "src/ast/variable.h" #include "src/ast/variable_decl_statement.h" #include "src/type_determiner.h" +#include "src/validator_impl.h" #include "src/validator_test_helper.h" namespace tint { diff --git a/src/validator_function_test.cc b/src/validator_function_test.cc index 4fb9ad5b46..d147dccf9b 100644 --- a/src/validator_function_test.cc +++ b/src/validator_function_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "src/validator_impl.h" - #include "gtest/gtest.h" #include "spirv/unified1/GLSL.std.450.h" #include "src/ast/call_statement.h" @@ -28,6 +26,7 @@ #include "src/ast/variable.h" #include "src/ast/variable_decl_statement.h" #include "src/type_determiner.h" +#include "src/validator_impl.h" #include "src/validator_test_helper.h" namespace tint { diff --git a/src/validator_test.cc b/src/validator_test.cc index a5236e2503..741e4320db 100644 --- a/src/validator_test.cc +++ b/src/validator_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "src/validator_impl.h" - #include "gtest/gtest.h" #include "spirv/unified1/GLSL.std.450.h" #include "src/ast/array_accessor_expression.h" @@ -54,6 +52,7 @@ #include "src/ast/variable.h" #include "src/ast/variable_decl_statement.h" #include "src/type_determiner.h" +#include "src/validator_impl.h" #include "src/validator_test_helper.h" namespace tint { diff --git a/src/validator_test_helper.cc b/src/validator_test_helper.cc index 0658e09762..39c667b5e7 100644 --- a/src/validator_test_helper.cc +++ b/src/validator_test_helper.cc @@ -13,6 +13,9 @@ // limitations under the License. #include "src/validator_test_helper.h" + +#include + #include "src/type_manager.h" namespace tint { diff --git a/src/validator_test_helper.h b/src/validator_test_helper.h index 2459eb7c27..c5ac6717dd 100644 --- a/src/validator_test_helper.h +++ b/src/validator_test_helper.h @@ -15,6 +15,8 @@ #ifndef SRC_VALIDATOR_TEST_HELPER_H_ #define SRC_VALIDATOR_TEST_HELPER_H_ +#include + #include "src/ast/type/void_type.h" #include "src/type_determiner.h" #include "src/validator_impl.h" diff --git a/src/writer/hlsl/generator_impl.cc b/src/writer/hlsl/generator_impl.cc index 7c3ed46390..151ec79462 100644 --- a/src/writer/hlsl/generator_impl.cc +++ b/src/writer/hlsl/generator_impl.cc @@ -14,7 +14,10 @@ #include "src/writer/hlsl/generator_impl.h" +#include #include +#include +#include #include "src/ast/array_accessor_expression.h" #include "src/ast/assignment_statement.h" diff --git a/src/writer/hlsl/generator_impl.h b/src/writer/hlsl/generator_impl.h index 9f3529a37b..d106b66822 100644 --- a/src/writer/hlsl/generator_impl.h +++ b/src/writer/hlsl/generator_impl.h @@ -15,6 +15,9 @@ #ifndef SRC_WRITER_HLSL_GENERATOR_IMPL_H_ #define SRC_WRITER_HLSL_GENERATOR_IMPL_H_ +#include +#include + #include "src/ast/intrinsic.h" #include "src/ast/literal.h" #include "src/ast/module.h" diff --git a/src/writer/hlsl/generator_impl_constructor_test.cc b/src/writer/hlsl/generator_impl_constructor_test.cc index 6f47277bb2..4211ee8ac5 100644 --- a/src/writer/hlsl/generator_impl_constructor_test.cc +++ b/src/writer/hlsl/generator_impl_constructor_test.cc @@ -65,7 +65,8 @@ TEST_F(HlslGeneratorImplTest_Constructor, EmitConstructor_UInt) { TEST_F(HlslGeneratorImplTest_Constructor, EmitConstructor_Float) { ast::type::F32Type f32; // Use a number close to 1<<30 but whose decimal representation ends in 0. - auto lit = std::make_unique(&f32, float((1 << 30) - 4)); + auto lit = std::make_unique( + &f32, static_cast((1 << 30) - 4)); ast::ScalarConstructorExpression expr(std::move(lit)); ASSERT_TRUE(gen().EmitConstructor(pre(), out(), &expr)) << gen().error(); diff --git a/src/writer/hlsl/generator_impl_function_entry_point_data_test.cc b/src/writer/hlsl/generator_impl_function_entry_point_data_test.cc index 04eca180ee..c22dfe4525 100644 --- a/src/writer/hlsl/generator_impl_function_entry_point_data_test.cc +++ b/src/writer/hlsl/generator_impl_function_entry_point_data_test.cc @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "src/ast/assignment_statement.h" #include "src/ast/decorated_variable.h" #include "src/ast/identifier_expression.h" @@ -30,8 +32,6 @@ #include "src/type_determiner.h" #include "src/writer/hlsl/test_helper.h" -#include - namespace tint { namespace writer { namespace hlsl { diff --git a/src/writer/hlsl/generator_impl_function_test.cc b/src/writer/hlsl/generator_impl_function_test.cc index c83247f6d5..a2a11b6470 100644 --- a/src/writer/hlsl/generator_impl_function_test.cc +++ b/src/writer/hlsl/generator_impl_function_test.cc @@ -564,7 +564,7 @@ void frag_main() { TEST_F( 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::F32Type f32; @@ -731,7 +731,7 @@ ep_1_out ep_1() { TEST_F( 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::F32Type f32; ast::type::VectorType vec4(&f32, 4); diff --git a/src/writer/hlsl/generator_impl_member_accessor_test.cc b/src/writer/hlsl/generator_impl_member_accessor_test.cc index 5faa38d356..efdf970b87 100644 --- a/src/writer/hlsl/generator_impl_member_accessor_test.cc +++ b/src/writer/hlsl/generator_impl_member_accessor_test.cc @@ -1041,7 +1041,7 @@ TEST_F(HlslGeneratorImplTest_MemberAccessor, TEST_F( HlslGeneratorImplTest_MemberAccessor, - EmitExpression_MemberAccessor_StorageBuffer_Load_MultiLevel_Swizzle_SingleLetter) { + EmitExpression_MemberAccessor_StorageBuffer_Load_MultiLevel_Swizzle_SingleLetter) { // NOLINT // struct Data { // [[offset(0)]] a : vec3; // [[offset(16)]] b : vec3; diff --git a/src/writer/hlsl/namer_test.cc b/src/writer/hlsl/namer_test.cc index cd5a1ce855..adb2ee5a91 100644 --- a/src/writer/hlsl/namer_test.cc +++ b/src/writer/hlsl/namer_test.cc @@ -13,6 +13,7 @@ // limitations under the License. #include "src/writer/hlsl/namer.h" + #include "gtest/gtest.h" namespace tint { diff --git a/src/writer/hlsl/test_helper.h b/src/writer/hlsl/test_helper.h index 99d5f98b91..93dcca24dc 100644 --- a/src/writer/hlsl/test_helper.h +++ b/src/writer/hlsl/test_helper.h @@ -16,6 +16,7 @@ #define SRC_WRITER_HLSL_TEST_HELPER_H_ #include +#include #include "gtest/gtest.h" #include "src/ast/module.h" diff --git a/src/writer/msl/generator_impl.cc b/src/writer/msl/generator_impl.cc index 6693d7f755..b56bd7fe4d 100644 --- a/src/writer/msl/generator_impl.cc +++ b/src/writer/msl/generator_impl.cc @@ -14,6 +14,11 @@ #include "src/writer/msl/generator_impl.h" +#include +#include +#include +#include + #include "src/ast/array_accessor_expression.h" #include "src/ast/assignment_statement.h" #include "src/ast/binary_expression.h" diff --git a/src/writer/msl/generator_impl_constructor_test.cc b/src/writer/msl/generator_impl_constructor_test.cc index 13fc4eb194..38132e13c0 100644 --- a/src/writer/msl/generator_impl_constructor_test.cc +++ b/src/writer/msl/generator_impl_constructor_test.cc @@ -72,7 +72,8 @@ TEST_F(MslGeneratorImplTest, EmitConstructor_UInt) { TEST_F(MslGeneratorImplTest, EmitConstructor_Float) { ast::type::F32Type f32; // Use a number close to 1<<30 but whose decimal representation ends in 0. - auto lit = std::make_unique(&f32, float((1 << 30) - 4)); + auto lit = std::make_unique( + &f32, static_cast((1 << 30) - 4)); ast::ScalarConstructorExpression expr(std::move(lit)); ast::Module m; diff --git a/src/writer/msl/generator_impl_function_entry_point_data_test.cc b/src/writer/msl/generator_impl_function_entry_point_data_test.cc index 29cddd2891..f404627f75 100644 --- a/src/writer/msl/generator_impl_function_entry_point_data_test.cc +++ b/src/writer/msl/generator_impl_function_entry_point_data_test.cc @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include "gtest/gtest.h" #include "src/ast/assignment_statement.h" #include "src/ast/decorated_variable.h" @@ -30,8 +32,6 @@ #include "src/type_determiner.h" #include "src/writer/msl/generator_impl.h" -#include - namespace tint { namespace writer { namespace msl { diff --git a/src/writer/msl/generator_impl_function_test.cc b/src/writer/msl/generator_impl_function_test.cc index 8959a68024..86d2d31606 100644 --- a/src/writer/msl/generator_impl_function_test.cc +++ b/src/writer/msl/generator_impl_function_test.cc @@ -485,7 +485,7 @@ fragment void frag_main(const device Data& coord [[buffer(0)]]) { TEST_F( 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::F32Type f32; @@ -666,7 +666,7 @@ fragment ep_1_out ep_1() { TEST_F( 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::F32Type f32; ast::type::VectorType vec4(&f32, 4); diff --git a/src/writer/msl/generator_impl_test.cc b/src/writer/msl/generator_impl_test.cc index cfbeef03e6..7e21912772 100644 --- a/src/writer/msl/generator_impl_test.cc +++ b/src/writer/msl/generator_impl_test.cc @@ -15,6 +15,7 @@ #include "src/writer/msl/generator_impl.h" #include +#include #include "gtest/gtest.h" #include "src/ast/function.h" diff --git a/src/writer/msl/namer_test.cc b/src/writer/msl/namer_test.cc index 3c30fa055c..56203a4986 100644 --- a/src/writer/msl/namer_test.cc +++ b/src/writer/msl/namer_test.cc @@ -13,6 +13,7 @@ // limitations under the License. #include "src/writer/msl/namer.h" + #include "gtest/gtest.h" namespace tint { diff --git a/src/writer/spirv/builder.cc b/src/writer/spirv/builder.cc index 5cf43ee020..1903704c1d 100644 --- a/src/writer/spirv/builder.cc +++ b/src/writer/spirv/builder.cc @@ -13,6 +13,7 @@ #include "src/writer/spirv/builder.h" +#include #include #include #include @@ -69,8 +70,6 @@ #include "src/ast/unary_op_expression.h" #include "src/ast/variable_decl_statement.h" -#include - namespace tint { namespace writer { namespace spirv { @@ -1866,8 +1865,8 @@ uint32_t Builder::GenerateTextureIntrinsic(ast::IdentifierExpression* ident, auto* texture_type = call->params()[0].get()->result_type()->UnwrapAll()->AsTexture(); - // TODO: Remove the LOD param from textureLoad on storage textures when - // https://github.com/gpuweb/gpuweb/pull/1032 gets merged. + // TODO(dsinclair): Remove the LOD param from textureLoad on storage textures + // when https://github.com/gpuweb/gpuweb/pull/1032 gets merged. if (ident->intrinsic() == ast::Intrinsic::kTextureLoad) { std::vector spirv_params = { std::move(wgsl_params[0]), std::move(wgsl_params[1]), diff --git a/src/writer/spirv/builder_function_decoration_test.cc b/src/writer/spirv/builder_function_decoration_test.cc index 26cfcf2274..dc8b7858bc 100644 --- a/src/writer/spirv/builder_function_decoration_test.cc +++ b/src/writer/spirv/builder_function_decoration_test.cc @@ -74,7 +74,7 @@ TEST_P(FunctionDecoration_StageTest, Emit) { ASSERT_TRUE(b.GenerateFunction(&func)) << b.error(); auto preamble = b.entry_points(); - ASSERT_TRUE(preamble.size() >= 1u); + ASSERT_GE(preamble.size(), 1u); EXPECT_EQ(preamble[0].opcode(), spv::Op::OpEntryPoint); ASSERT_GE(preamble[0].operands().size(), 3u); diff --git a/src/writer/spirv/generator.h b/src/writer/spirv/generator.h index c907ef3478..f5968b2d2d 100644 --- a/src/writer/spirv/generator.h +++ b/src/writer/spirv/generator.h @@ -16,6 +16,7 @@ #define SRC_WRITER_SPIRV_GENERATOR_H_ #include +#include #include #include "src/ast/module.h" diff --git a/src/writer/wgsl/generator_impl_constructor_test.cc b/src/writer/wgsl/generator_impl_constructor_test.cc index 9ce40ecc49..ef21cac83e 100644 --- a/src/writer/wgsl/generator_impl_constructor_test.cc +++ b/src/writer/wgsl/generator_impl_constructor_test.cc @@ -67,7 +67,8 @@ TEST_F(WgslGeneratorImplTest, EmitConstructor_UInt) { TEST_F(WgslGeneratorImplTest, EmitConstructor_Float) { ast::type::F32Type f32; // Use a number close to 1<<30 but whose decimal representation ends in 0. - auto lit = std::make_unique(&f32, float((1 << 30) - 4)); + auto lit = std::make_unique( + &f32, static_cast((1 << 30) - 4)); ast::ScalarConstructorExpression expr(std::move(lit)); GeneratorImpl g; diff --git a/tools/lint b/tools/lint index 35d88d423a..0157fa6c77 100755 --- a/tools/lint +++ b/tools/lint @@ -15,5 +15,6 @@ set -e # fail on error -./third_party/cpplint/cpplint/cpplint.py --root=. `find src -type f` -./third_party/cpplint/cpplint/cpplint.py --root=. `find samples -type f` +FILTER="-runtime/references" +./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`