From 61d76ebb5c636a501fd4ec07db56164b7380d589 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Mon, 30 May 2022 18:00:58 +0000 Subject: [PATCH] Update some forward declarations. This CL removes some forward declarations which are no longer needed and adds one missing declaration which was pulled in from other headers. These were found by the clang-tidy bugprone-forward-declaration-namespace check. Bug: dawn:1414 Change-Id: I8906861e472f2d64a1547c8c6de348cd4151ffb5 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91742 Reviewed-by: Ben Clayton Kokoro: Kokoro Auto-Submit: Dan Sinclair Commit-Queue: Dan Sinclair Reviewed-by: Corentin Wallez --- .clang-tidy | 1 - src/dawn/native/opengl/GLFormat.h | 2 -- src/tint/ast/node.h | 9 --------- src/tint/inspector/resource_binding.h | 5 +++++ src/tint/sem/array.h | 5 ----- src/tint/sem/block_statement.h | 1 - src/tint/sem/module.h | 1 - src/tint/sem/statement.h | 1 - src/tint/writer/glsl/generator.h | 3 --- src/tint/writer/hlsl/generator.h | 3 --- src/tint/writer/msl/generator.h | 3 --- 11 files changed, 5 insertions(+), 29 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 532e020767..1dc5f3b8e5 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -7,7 +7,6 @@ Checks: "-*,\ -bugprone-branch-clone,\ -bugprone-copy-constructor-init,\ -bugprone-easily-swappable-parameters,\ - -bugprone-forward-declaration-namespace,\ -bugprone-forwarding-reference-overload,\ -bugprone-implicit-widening-of-multiplication-result,\ -bugprone-lambda-function-name,\ diff --git a/src/dawn/native/opengl/GLFormat.h b/src/dawn/native/opengl/GLFormat.h index ea3db9aa86..6d1d81e58e 100644 --- a/src/dawn/native/opengl/GLFormat.h +++ b/src/dawn/native/opengl/GLFormat.h @@ -20,8 +20,6 @@ namespace dawn::native::opengl { -class Device; - struct GLFormat { GLenum internalFormat = 0; GLenum format = 0; diff --git a/src/tint/ast/node.h b/src/tint/ast/node.h index 41eeefe609..19d768228a 100644 --- a/src/tint/ast/node.h +++ b/src/tint/ast/node.h @@ -19,15 +19,6 @@ #include "src/tint/clone_context.h" -// Forward declarations -namespace tint { -class CloneContext; -} // namespace tint -namespace tint::sem { -class Type; -class Info; -} // namespace tint::sem - namespace tint::ast { /// AST base class node diff --git a/src/tint/inspector/resource_binding.h b/src/tint/inspector/resource_binding.h index 9a544357f9..6adab5a7fc 100644 --- a/src/tint/inspector/resource_binding.h +++ b/src/tint/inspector/resource_binding.h @@ -20,6 +20,11 @@ #include "src/tint/ast/storage_texture.h" #include "src/tint/ast/texture.h" +// Forward declarations +namespace tint::sem { +class Type; +} // namespace tint::sem + namespace tint::inspector { /// Container for information about how a resource is bound diff --git a/src/tint/sem/array.h b/src/tint/sem/array.h index aeef3cedbe..7f72d8a8a1 100644 --- a/src/tint/sem/array.h +++ b/src/tint/sem/array.h @@ -21,11 +21,6 @@ #include "src/tint/sem/node.h" #include "src/tint/sem/type.h" -// Forward declarations -namespace tint::ast { -class Array; -} // namespace tint::ast - namespace tint::sem { /// Array holds the semantic information for Array nodes. diff --git a/src/tint/sem/block_statement.h b/src/tint/sem/block_statement.h index e87b225246..4f12122dbd 100644 --- a/src/tint/sem/block_statement.h +++ b/src/tint/sem/block_statement.h @@ -24,7 +24,6 @@ namespace tint::ast { class BlockStatement; class ContinueStatement; -class Function; class Variable; } // namespace tint::ast diff --git a/src/tint/sem/module.h b/src/tint/sem/module.h index a7b3d452fd..dffe003590 100644 --- a/src/tint/sem/module.h +++ b/src/tint/sem/module.h @@ -23,7 +23,6 @@ // Forward declarations namespace tint::ast { class Node; -class Module; } // namespace tint::ast namespace tint::sem { diff --git a/src/tint/sem/statement.h b/src/tint/sem/statement.h index 741a3258f9..bdcb55c706 100644 --- a/src/tint/sem/statement.h +++ b/src/tint/sem/statement.h @@ -20,7 +20,6 @@ // Forward declarations namespace tint::ast { -class Function; class Statement; } // namespace tint::ast namespace tint::sem { diff --git a/src/tint/writer/glsl/generator.h b/src/tint/writer/glsl/generator.h index 77a7f4b1bb..d48b0bc7d9 100644 --- a/src/tint/writer/glsl/generator.h +++ b/src/tint/writer/glsl/generator.h @@ -32,9 +32,6 @@ namespace tint { class Program; } // namespace tint -namespace tint::writer::glsl { -class GeneratorImpl; -} // namespace tint::writer::glsl namespace tint::writer::glsl { diff --git a/src/tint/writer/hlsl/generator.h b/src/tint/writer/hlsl/generator.h index f658c9949e..f14da6d113 100644 --- a/src/tint/writer/hlsl/generator.h +++ b/src/tint/writer/hlsl/generator.h @@ -30,9 +30,6 @@ namespace tint { class Program; } // namespace tint -namespace tint::writer::hlsl { -class GeneratorImpl; -} // namespace tint::writer::hlsl namespace tint::writer::hlsl { diff --git a/src/tint/writer/msl/generator.h b/src/tint/writer/msl/generator.h index 43b0cb7417..d4208cc262 100644 --- a/src/tint/writer/msl/generator.h +++ b/src/tint/writer/msl/generator.h @@ -28,9 +28,6 @@ namespace tint { class Program; } // namespace tint -namespace tint::writer::msl { -class GeneratorImpl; -} // namespace tint::writer::msl namespace tint::writer::msl {