summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-type.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-02-17 13:23:27 -0800
committerGitHub <noreply@github.com>2023-02-17 13:23:27 -0800
commit051607368e8d3dd55d2ad2b2200ef656244ec70d (patch)
treec1a6ce8d7551e5a74e36349d43ee4c05ae6ed21c /source/slang/slang-check-type.cpp
parent79049bc7617be0d20f6ed5d9d1dfe75006aa675a (diff)
Fixed crash when lowering IR for no_diff struct member. (#2658)
* Fixed crash when lowering IR for no_diff struct member. * Improve `setInsertBeforeOrdinaryInst` and `setInsertAfterOrdinaryInst`. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-type.cpp')
-rw-r--r--source/slang/slang-check-type.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/slang/slang-check-type.cpp b/source/slang/slang-check-type.cpp
index d402dde03..1b2179144 100644
--- a/source/slang/slang-check-type.cpp
+++ b/source/slang/slang-check-type.cpp
@@ -84,6 +84,15 @@ namespace Slang
return TranslateTypeNodeForced(typeExp);
}
+ Type* SemanticsVisitor::getRemovedModifierType(ModifiedType* modifiedType, ModifierVal* modifier)
+ {
+ if (modifiedType->modifiers.getCount() == 1)
+ return modifiedType->base;
+ auto newModifiers = modifiedType->modifiers;
+ newModifiers.remove(modifier);
+ return m_astBuilder->getModifiedType(modifiedType->base, newModifiers);
+ }
+
Expr* SemanticsVisitor::ExpectATypeRepr(Expr* expr)
{
if (auto overloadedExpr = as<OverloadedExpr>(expr))