mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 00:17:03 +00:00
sem: Rename Function methods
Explicitly name references as either Direct or Transitive. Rename workgroup_size() to WorkgroupSize(). Remove the return_statements. These were not used anywhere. Change-Id: I7191665db9c3211d086dd90939abec7003cd7be7 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/68405 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
@@ -64,7 +64,7 @@ void BindingRemapper::Run(CloneContext& ctx, const DataMap& inputs, DataMap&) {
|
||||
}
|
||||
auto* func = ctx.src->Sem().Get(func_ast);
|
||||
std::unordered_map<sem::BindingPoint, int> binding_point_counts;
|
||||
for (auto* var : func->ReferencedModuleVariables()) {
|
||||
for (auto* var : func->TransitivelyReferencedGlobals()) {
|
||||
if (auto binding_point = var->Declaration()->BindingPoint()) {
|
||||
BindingPoint from{binding_point.group->value,
|
||||
binding_point.binding->value};
|
||||
|
||||
@@ -98,7 +98,7 @@ struct ModuleScopeVarToEntryPointParam::State {
|
||||
auto* func_sem = ctx.src->Sem().Get(func_ast);
|
||||
|
||||
bool needs_processing = false;
|
||||
for (auto* var : func_sem->ReferencedModuleVariables()) {
|
||||
for (auto* var : func_sem->TransitivelyReferencedGlobals()) {
|
||||
if (var->StorageClass() != ast::StorageClass::kNone) {
|
||||
needs_processing = true;
|
||||
break;
|
||||
@@ -155,7 +155,7 @@ struct ModuleScopeVarToEntryPointParam::State {
|
||||
return workgroup_parameter_symbol;
|
||||
};
|
||||
|
||||
for (auto* var : func_sem->ReferencedModuleVariables()) {
|
||||
for (auto* var : func_sem->TransitivelyReferencedGlobals()) {
|
||||
auto sc = var->StorageClass();
|
||||
if (sc == ast::StorageClass::kNone) {
|
||||
continue;
|
||||
@@ -312,7 +312,7 @@ struct ModuleScopeVarToEntryPointParam::State {
|
||||
|
||||
// Add new arguments for any variables that are needed by the callee.
|
||||
// For entry points, pass non-handle types as pointers.
|
||||
for (auto* target_var : target_sem->ReferencedModuleVariables()) {
|
||||
for (auto* target_var : target_sem->TransitivelyReferencedGlobals()) {
|
||||
auto sc = target_var->StorageClass();
|
||||
if (sc == ast::StorageClass::kNone) {
|
||||
continue;
|
||||
|
||||
@@ -63,7 +63,7 @@ void SingleEntryPoint::Run(CloneContext& ctx, const DataMap& inputs, DataMap&) {
|
||||
|
||||
// Build set of referenced module-scope variables for faster lookups later.
|
||||
std::unordered_set<const ast::Variable*> referenced_vars;
|
||||
for (auto* var : sem.Get(entry_point)->ReferencedModuleVariables()) {
|
||||
for (auto* var : sem.Get(entry_point)->TransitivelyReferencedGlobals()) {
|
||||
referenced_vars.emplace(var->Declaration());
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ struct ZeroInitWorkgroupMemory::State {
|
||||
// Generate a list of statements to zero initialize each of the
|
||||
// workgroup storage variables used by `fn`. This will populate #statements.
|
||||
auto* func = sem.Get(fn);
|
||||
for (auto* var : func->ReferencedModuleVariables()) {
|
||||
for (auto* var : func->TransitivelyReferencedGlobals()) {
|
||||
if (var->StorageClass() == ast::StorageClass::kWorkgroup) {
|
||||
BuildZeroingStatements(
|
||||
var->Type()->UnwrapRef(), [&](uint32_t num_values) {
|
||||
|
||||
Reference in New Issue
Block a user