summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-peephole.cpp
diff options
context:
space:
mode:
authorkaizhangNV <149626564+kaizhangNV@users.noreply.github.com>2025-04-09 16:24:17 -0500
committerGitHub <noreply@github.com>2025-04-09 14:24:17 -0700
commitfd09feaaa19c1ae3441dd687bced1b12ff7c768e (patch)
treee6f30188ffef052e8930b5ebf3131973355bb8ce /source/slang/slang-ir-peephole.cpp
parent87c96bcfa89905d237dc0452f255ebf61307c441 (diff)
void field rework (#6739)
* void field rework * move void cleanup pass earlier
Diffstat (limited to 'source/slang/slang-ir-peephole.cpp')
-rw-r--r--source/slang/slang-ir-peephole.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/slang/slang-ir-peephole.cpp b/source/slang/slang-ir-peephole.cpp
index e29fdf975..28e98fdb6 100644
--- a/source/slang/slang-ir-peephole.cpp
+++ b/source/slang/slang-ir-peephole.cpp
@@ -402,6 +402,12 @@ struct PeepholeContext : InstPassBase
Index i = 0;
for (auto sfield : structType->getFields())
{
+ // skip the void field
+ if (as<IRVoidType>(sfield->getFieldType()))
+ {
+ continue;
+ }
+
if (sfield->getKey() == field)
{
fieldIndex = i;