mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
Big cleanup now that AST nodes are raw pointers
Remove all redundant std::move()s. I've also removed calls to
std::move() in tests, even if they act as an optimization. This is for
two reasons:
(a) Performance is not important for testing, and this helps with
readability.
(b) A whole bunch tests were relying on std::move() clearing vectors so
they can be repopulated and used again. This is undefined behavior:
> Objects of types defined in the C++ standard library may be moved from
> (12.8). Move operations may be explicitly specified or implicitly
> generated. Unless otherwise specified, such moved-from objects shall
> be placed in a valid but unspecified state.
All of these UB cases have been fixed.
Removed all duplicate variables left over from:
`auto* foo_ptr = foo.get()`
which became:
`auto* foo_ptr = foo`
Bug: tint:322
Change-Id: Ibd08a2379671382320fd4d8da296ccc6a378b8af
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32900
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
b053acf796
commit
4bfe461646
@@ -199,7 +199,7 @@ std::vector<ResourceBinding> Inspector::GetUniformBufferResourceBindings(
|
||||
entry.min_buffer_binding_size = var->type()->MinBufferBindingSize(
|
||||
ast::type::MemoryLayout::kUniformBuffer);
|
||||
|
||||
result.push_back(std::move(entry));
|
||||
result.push_back(entry);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -234,7 +234,7 @@ std::vector<ResourceBinding> Inspector::GetSamplerResourceBindings(
|
||||
entry.bind_group = binding_info.set->value();
|
||||
entry.binding = binding_info.binding->value();
|
||||
|
||||
result.push_back(std::move(entry));
|
||||
result.push_back(entry);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -258,7 +258,7 @@ std::vector<ResourceBinding> Inspector::GetComparisonSamplerResourceBindings(
|
||||
entry.bind_group = binding_info.set->value();
|
||||
entry.binding = binding_info.binding->value();
|
||||
|
||||
result.push_back(std::move(entry));
|
||||
result.push_back(entry);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -321,7 +321,7 @@ std::vector<ResourceBinding> Inspector::GetStorageBufferResourceBindingsImpl(
|
||||
entry.min_buffer_binding_size = var->type()->MinBufferBindingSize(
|
||||
ast::type::MemoryLayout::kStorageBuffer);
|
||||
|
||||
result.push_back(std::move(entry));
|
||||
result.push_back(entry);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -401,7 +401,7 @@ std::vector<ResourceBinding> Inspector::GetSampledTextureResourceBindingsImpl(
|
||||
entry.sampled_kind = ResourceBinding::SampledKind::kUnknown;
|
||||
}
|
||||
|
||||
result.push_back(std::move(entry));
|
||||
result.push_back(entry);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user