summaryrefslogtreecommitdiff
path: root/source/slang/slang-ast-builder.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2025-02-20 14:48:51 -0800
committerGitHub <noreply@github.com>2025-02-20 14:48:51 -0800
commit19867ffca6dca7995c799354081219c9e76f13d1 (patch)
treeb9153428fc8b7b6f3069931cf816ad374a2e7c52 /source/slang/slang-ast-builder.cpp
parent9580e311e0cefb0f8e11afc316783a67201654eb (diff)
Simplify implicit cast ctors for vector & matrix. (#6408)
* Simplify implicit cast ctors for vector & matrix. * Fix formatting. * Fix tests. * Fix Falcor test. * Mark __builtin_cast as internal.
Diffstat (limited to 'source/slang/slang-ast-builder.cpp')
-rw-r--r--source/slang/slang-ast-builder.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/slang/slang-ast-builder.cpp b/source/slang/slang-ast-builder.cpp
index 6ffaee7db..b3afa5310 100644
--- a/source/slang/slang-ast-builder.cpp
+++ b/source/slang/slang-ast-builder.cpp
@@ -948,6 +948,14 @@ SubtypeWitness* ASTBuilder::getConjunctionSubtypeWitness(
return witness;
}
+TypeCoercionWitness* ASTBuilder::getTypeCoercionWitness(
+ Type* subType,
+ Type* superType,
+ DeclRef<Decl> declRef)
+{
+ return getOrCreate<TypeCoercionWitness>(subType, superType, declRef.declRefBase);
+}
+
DeclRef<Decl> _getMemberDeclRef(ASTBuilder* builder, DeclRef<Decl> parent, Decl* decl)
{
return builder->getMemberDeclRef(parent, decl);