ast: Move Module function methods to FunctionList

Module will be split into Module (immutable) and ModuleBuilder (mutable).
By moving these methods to the FunctionList, we can deduplicate a bunch of common logic.

Bug: tint:390
Change-Id: I3fd85200aae4e8dc3d5afce8c9aaa6512809a3a0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/38363
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton
2021-01-21 18:45:50 +00:00
committed by Commit Bot service account
parent 281b602f59
commit 6761160dc1
38 changed files with 354 additions and 305 deletions

View File

@@ -50,7 +50,7 @@ Inspector::~Inspector() = default;
std::vector<EntryPoint> Inspector::GetEntryPoints() {
std::vector<EntryPoint> result;
for (auto* func : module_.functions()) {
for (auto* func : module_.Functions()) {
if (!func->IsEntryPoint()) {
continue;
}
@@ -278,7 +278,7 @@ std::vector<ResourceBinding> Inspector::GetMultisampledTextureResourceBindings(
}
ast::Function* Inspector::FindEntryPointByName(const std::string& name) {
auto* func = module_.FindFunctionBySymbol(module_.GetSymbol(name));
auto* func = module_.Functions().Find(module_.GetSymbol(name));
if (!func) {
error_ += name + " was not found!";
return nullptr;