diff options
Diffstat (limited to 'source/slang/slang-check-type.cpp')
| -rw-r--r-- | source/slang/slang-check-type.cpp | 13 |
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; |
