Move CloneContext and Traits from src/ast to src/

CloneContext clones the AST, types, symbols and in the future semantic info.
3/4 of these are non-ast, so promote these up to the root.

Bug: tint:390
Change-Id: I49619796e6f81f9ab64f79413a12c87312cb1901
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38361
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton
2021-01-21 16:20:40 +00:00
committed by Commit Bot service account
parent f12054ea2a
commit 1e29f4beb0
81 changed files with 150 additions and 158 deletions

View File

@@ -16,8 +16,8 @@
#include <assert.h>
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/clone_context.h"
TINT_INSTANTIATE_CLASS_ID(tint::type::AccessControl);

View File

@@ -16,8 +16,8 @@
#include <assert.h>
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/clone_context.h"
TINT_INSTANTIATE_CLASS_ID(tint::type::Alias);

View File

@@ -17,9 +17,9 @@
#include <cmath>
#include <memory>
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/ast/stride_decoration.h"
#include "src/clone_context.h"
#include "src/type/vector_type.h"
TINT_INSTANTIATE_CLASS_ID(tint::type::Array);

View File

@@ -14,8 +14,8 @@
#include "src/type/bool_type.h"
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/clone_context.h"
TINT_INSTANTIATE_CLASS_ID(tint::type::Bool);

View File

@@ -17,8 +17,8 @@
#include <cassert>
#include <sstream>
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/clone_context.h"
TINT_INSTANTIATE_CLASS_ID(tint::type::DepthTexture);

View File

@@ -14,8 +14,8 @@
#include "src/type/f32_type.h"
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/clone_context.h"
TINT_INSTANTIATE_CLASS_ID(tint::type::F32);

View File

@@ -14,8 +14,8 @@
#include "src/type/i32_type.h"
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/clone_context.h"
TINT_INSTANTIATE_CLASS_ID(tint::type::I32);

View File

@@ -16,8 +16,8 @@
#include <assert.h>
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/clone_context.h"
#include "src/type/array_type.h"
#include "src/type/vector_type.h"

View File

@@ -17,8 +17,8 @@
#include <cassert>
#include <sstream>
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/clone_context.h"
TINT_INSTANTIATE_CLASS_ID(tint::type::MultisampledTexture);

View File

@@ -14,8 +14,8 @@
#include "src/type/pointer_type.h"
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/clone_context.h"
TINT_INSTANTIATE_CLASS_ID(tint::type::Pointer);

View File

@@ -17,8 +17,8 @@
#include <cassert>
#include <sstream>
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/clone_context.h"
TINT_INSTANTIATE_CLASS_ID(tint::type::SampledTexture);

View File

@@ -14,8 +14,8 @@
#include "src/type/sampler_type.h"
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/clone_context.h"
TINT_INSTANTIATE_CLASS_ID(tint::type::Sampler);

View File

@@ -17,8 +17,8 @@
#include <cassert>
#include <sstream>
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/clone_context.h"
TINT_INSTANTIATE_CLASS_ID(tint::type::StorageTexture);

View File

@@ -17,8 +17,8 @@
#include <cmath>
#include <utility>
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/clone_context.h"
#include "src/type/alias_type.h"
#include "src/type/array_type.h"
#include "src/type/matrix_type.h"

View File

@@ -21,15 +21,14 @@
namespace tint {
// Forward declarations
class CloneContext;
namespace ast {
class Module;
class CloneContext;
} // namespace ast
namespace type {
using CloneContext = ast::CloneContext; // TEMP
/// Supported memory layouts for calculating sizes
enum class MemoryLayout { kUniformBuffer, kStorageBuffer };
@@ -43,7 +42,7 @@ class Type : public Castable<Type> {
/// Clones this type and all transitive types using the `CloneContext` `ctx`.
/// @param ctx the clone context
/// @return the newly cloned type
virtual Type* Clone(ast::CloneContext* ctx) const = 0;
virtual Type* Clone(CloneContext* ctx) const = 0;
/// @returns the name for this type. The type name is unique over all types.
virtual std::string type_name() const = 0;

View File

@@ -14,8 +14,8 @@
#include "src/type/u32_type.h"
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/clone_context.h"
TINT_INSTANTIATE_CLASS_ID(tint::type::U32);

View File

@@ -17,8 +17,8 @@
#include <assert.h>
#include <cmath>
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/clone_context.h"
TINT_INSTANTIATE_CLASS_ID(tint::type::Vector);

View File

@@ -14,8 +14,8 @@
#include "src/type/void_type.h"
#include "src/ast/clone_context.h"
#include "src/ast/module.h"
#include "src/clone_context.h"
TINT_INSTANTIATE_CLASS_ID(tint::type::Void);