summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-stmt.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-07-19 13:50:49 -0700
committerGitHub <noreply@github.com>2023-07-19 13:50:49 -0700
commit1cfb1c85b52e00cde2d21874a88cda2c22d18b62 (patch)
treea38b24534d865ffe33a3d0fc030f5449ba729e28 /source/slang/slang-check-stmt.cpp
parent1fe5e83f3dcc8ef0efa2dd083ebdfab5d0f101a9 (diff)
Optimize specialization, and remove unnecessary calls to `simplifyIR`. (#2999)
* Remove unneccessary calls to `simplifyIR`. * fix. * Delete obsolete hoistConst pass. * Fix. * Small improvements. * Fix. * Fix enum lowering. * fix * tweaks. * tweaks. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-stmt.cpp')
-rw-r--r--source/slang/slang-check-stmt.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/slang-check-stmt.cpp b/source/slang/slang-check-stmt.cpp
index 6453f68ab..ba7e977e3 100644
--- a/source/slang/slang-check-stmt.cpp
+++ b/source/slang/slang-check-stmt.cpp
@@ -492,7 +492,7 @@ namespace Slang
auto varExpr = as<VarExpr>(opSideEffectExpr->arguments[0]);
if (!varExpr)
return;
- if (varExpr->declRef != initialVar)
+ if (varExpr->declRef.getDecl() != initialVar.getDecl())
{
// If the user writes something like `for (int i = 0; i < 5; j++)`,
// it is most likely a bug, so we issue a warning.
@@ -518,7 +518,7 @@ namespace Slang
stepSize = m_astBuilder->getIntVal(m_astBuilder->getIntType(), 1);
}
- if (predicateVar != initialVar)
+ if (predicateVar.getDecl() != initialVar.getDecl())
{
if (predicateVar)
getSink()->diagnose(stmt->predicateExpression, Diagnostics::forLoopPredicateCheckingDifferentVar, initialVar, predicateVar);