mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 02:39:11 +00:00
Move ast/address_space to type/
This CL moves the ast/address_space to type/address_space. This breaks the type dependency on ast for AddressSpace. Change-Id: Icb48e7423e18904865ec735024eb3b9864c947c2 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/117604 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
3cbf3fc4c5
commit
18b2158b4e
@@ -50,7 +50,7 @@ struct AccessRoot {
|
||||
/// function-scope variable ('function'), or pointer parameter in the source program.
|
||||
tint::sem::Variable const* variable = nullptr;
|
||||
/// The address space of the variable or pointer type.
|
||||
tint::ast::AddressSpace address_space = tint::ast::AddressSpace::kUndefined;
|
||||
tint::type::AddressSpace address_space = tint::type::AddressSpace::kUndefined;
|
||||
};
|
||||
|
||||
/// Inequality operator for AccessRoot
|
||||
@@ -450,7 +450,7 @@ struct DirectVariableAccess::State {
|
||||
Switch(
|
||||
variable->Declaration(),
|
||||
[&](const ast::Var*) {
|
||||
if (variable->AddressSpace() != ast::AddressSpace::kHandle) {
|
||||
if (variable->AddressSpace() != type::AddressSpace::kHandle) {
|
||||
// Start a new access chain for the non-handle 'var' access
|
||||
create_new_chain();
|
||||
}
|
||||
@@ -749,15 +749,15 @@ struct DirectVariableAccess::State {
|
||||
|
||||
/// @returns true if the address space @p address_space requires transforming given the
|
||||
/// transform's options.
|
||||
bool AddressSpaceRequiresTransform(ast::AddressSpace address_space) const {
|
||||
bool AddressSpaceRequiresTransform(type::AddressSpace address_space) const {
|
||||
switch (address_space) {
|
||||
case ast::AddressSpace::kUniform:
|
||||
case ast::AddressSpace::kStorage:
|
||||
case ast::AddressSpace::kWorkgroup:
|
||||
case type::AddressSpace::kUniform:
|
||||
case type::AddressSpace::kStorage:
|
||||
case type::AddressSpace::kWorkgroup:
|
||||
return true;
|
||||
case ast::AddressSpace::kPrivate:
|
||||
case type::AddressSpace::kPrivate:
|
||||
return opts.transform_private;
|
||||
case ast::AddressSpace::kFunction:
|
||||
case type::AddressSpace::kFunction:
|
||||
return opts.transform_function;
|
||||
default:
|
||||
return false;
|
||||
@@ -1180,9 +1180,9 @@ struct DirectVariableAccess::State {
|
||||
for (auto* param : fn->Parameters()) {
|
||||
if (auto* ptr = param->Type()->As<type::Pointer>()) {
|
||||
switch (ptr->AddressSpace()) {
|
||||
case ast::AddressSpace::kUniform:
|
||||
case ast::AddressSpace::kStorage:
|
||||
case ast::AddressSpace::kWorkgroup:
|
||||
case type::AddressSpace::kUniform:
|
||||
case type::AddressSpace::kStorage:
|
||||
case type::AddressSpace::kWorkgroup:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@@ -1193,8 +1193,8 @@ struct DirectVariableAccess::State {
|
||||
}
|
||||
|
||||
/// @returns true if the given address space is 'private' or 'function'.
|
||||
static bool IsPrivateOrFunction(const ast::AddressSpace sc) {
|
||||
return sc == ast::AddressSpace::kPrivate || sc == ast::AddressSpace::kFunction;
|
||||
static bool IsPrivateOrFunction(const type::AddressSpace sc) {
|
||||
return sc == type::AddressSpace::kPrivate || sc == type::AddressSpace::kFunction;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user