Program: Remove deprecated types and nodes methods
Fixup all usages Bug: tint:390 Change-Id: I14c9a0420be7da2d26bf21bce96ca0ded0978711 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38548 Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
parent
83158f214f
commit
cf757e3a89
|
@ -64,18 +64,18 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
|||
|
||||
// Check that none of the AST nodes or type pointers in dst are found in src
|
||||
std::unordered_set<tint::ast::Node*> src_nodes;
|
||||
for (auto* src_node : src.nodes()) {
|
||||
for (auto* src_node : src.Nodes().Objects()) {
|
||||
src_nodes.emplace(src_node);
|
||||
}
|
||||
std::unordered_set<tint::type::Type*> src_types;
|
||||
for (auto& src_type : src.types()) {
|
||||
src_types.emplace(src_type.second);
|
||||
for (auto* src_type : src.Types()) {
|
||||
src_types.emplace(src_type);
|
||||
}
|
||||
for (auto* dst_node : dst.nodes()) {
|
||||
for (auto* dst_node : dst.Nodes().Objects()) {
|
||||
ASSERT_EQ(src_nodes.count(dst_node), 0u);
|
||||
}
|
||||
for (auto& dst_type : dst.types()) {
|
||||
ASSERT_EQ(src_types.count(dst_type.second), 0u);
|
||||
for (auto* dst_type : dst.Types()) {
|
||||
ASSERT_EQ(src_types.count(dst_type), 0u);
|
||||
}
|
||||
|
||||
// Regenerate the wgsl for the src program. We use this instead of the
|
||||
|
|
|
@ -123,19 +123,18 @@ fn main() -> void {
|
|||
|
||||
// Check that none of the AST nodes or type pointers in dst are found in src
|
||||
std::unordered_set<ast::Node*> src_nodes;
|
||||
for (auto* src_node : src.nodes()) {
|
||||
for (auto* src_node : src.Nodes().Objects()) {
|
||||
src_nodes.emplace(src_node);
|
||||
}
|
||||
std::unordered_set<type::Type*> src_types;
|
||||
for (auto& src_type : src.types()) {
|
||||
src_types.emplace(src_type.second);
|
||||
for (auto* src_type : src.Types()) {
|
||||
src_types.emplace(src_type);
|
||||
}
|
||||
for (auto* dst_node : dst.nodes()) {
|
||||
for (auto* dst_node : dst.Nodes().Objects()) {
|
||||
ASSERT_EQ(src_nodes.count(dst_node), 0u) << dst_node->str();
|
||||
}
|
||||
for (auto& dst_type : dst.types()) {
|
||||
ASSERT_EQ(src_types.count(dst_type.second), 0u)
|
||||
<< dst_type.second->type_name();
|
||||
for (auto* dst_type : dst.Types()) {
|
||||
ASSERT_EQ(src_types.count(dst_type), 0u) << dst_type->type_name();
|
||||
}
|
||||
|
||||
// Regenerate the wgsl for the src program. We use this instead of the
|
||||
|
|
|
@ -118,19 +118,6 @@ class Program {
|
|||
return types_.Get<T>(std::forward<ARGS>(args)...);
|
||||
}
|
||||
|
||||
/// Returns all the declared types in the program
|
||||
/// [DEPRECATED]: Use AST().Types().types()
|
||||
/// @returns the mapping from name string to type.
|
||||
const std::unordered_map<std::string, type::Type*>& types() {
|
||||
return types_.types();
|
||||
}
|
||||
|
||||
/// @returns all the declared nodes in the program
|
||||
/// [DEPRECATED]: Use Nodes().Objects()
|
||||
BlockAllocator<ast::Node>::ConstView nodes() const {
|
||||
return Nodes().Objects();
|
||||
}
|
||||
|
||||
/// Registers `name` as a symbol
|
||||
/// @param name the name to register
|
||||
/// @returns the symbol for the `name`. If `name` is already registered the
|
||||
|
|
|
@ -65,7 +65,7 @@ class Manager {
|
|||
|
||||
/// Returns the type map
|
||||
/// @returns the mapping from name string to type.
|
||||
const std::unordered_map<std::string, type::Type*>& types() {
|
||||
const std::unordered_map<std::string, type::Type*>& types() const {
|
||||
return by_name_;
|
||||
}
|
||||
|
||||
|
|
|
@ -101,9 +101,8 @@ void TypeDeterminer::set_referenced_from_function_if_needed(ast::Variable* var,
|
|||
|
||||
bool TypeDeterminer::Determine() {
|
||||
std::vector<type::StorageTexture*> storage_textures;
|
||||
for (auto& it : program_->types()) {
|
||||
if (auto* storage =
|
||||
it.second->UnwrapIfNeeded()->As<type::StorageTexture>()) {
|
||||
for (auto* ty : program_->Types()) {
|
||||
if (auto* storage = ty->UnwrapIfNeeded()->As<type::StorageTexture>()) {
|
||||
storage_textures.emplace_back(storage);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue