From 1d4b5b6fd2433a10cc7ab87626cb560f54b0acbb Mon Sep 17 00:00:00 2001 From: Yong He Date: Sun, 3 Sep 2023 12:56:31 -0700 Subject: Proper lowering of functiosn that returns NonCopyable values. (#3179) * Proper lowering of functiosn that returns NonCopyable values. * Fix tests. * Fix clang errors. * Fix. * Fix clang error. --------- Co-authored-by: Yong He --- source/slang/slang-ast-type.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/slang/slang-ast-type.cpp') diff --git a/source/slang/slang-ast-type.cpp b/source/slang/slang-ast-type.cpp index 9704b4c87..f80de86fd 100644 --- a/source/slang/slang-ast-type.cpp +++ b/source/slang/slang-ast-type.cpp @@ -796,4 +796,14 @@ Type* removeParamDirType(Type* type) return type; } +bool isNonCopyableType(Type* type) +{ + auto declRefType = as(type); + if (!declRefType) + return false; + if (declRefType->getDeclRef().getDecl()->findModifier()) + return true; + return false; +} + } // namespace Slang -- cgit v1.2.3