summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-type.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-type.cpp')
-rw-r--r--source/slang/slang-check-type.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/slang/slang-check-type.cpp b/source/slang/slang-check-type.cpp
index dc0d69f04..50bc55641 100644
--- a/source/slang/slang-check-type.cpp
+++ b/source/slang/slang-check-type.cpp
@@ -22,6 +22,19 @@ namespace Slang
return typeOut.type;
}
+ Type* getPointedToTypeIfCanImplicitDeref(Type* type)
+ {
+ if (auto ptrLike = as<PointerLikeType>(type))
+ {
+ return ptrLike->getElementType();
+ }
+ else if (auto ptrType = as<PtrType>(type))
+ {
+ return ptrType->getValueType();
+ }
+ return nullptr;
+ }
+
Expr* SemanticsVisitor::TranslateTypeNodeImpl(Expr* node)
{
if (!node) return nullptr;