summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ast-type.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-09-03 12:56:31 -0700
committerGitHub <noreply@github.com>2023-09-03 12:56:31 -0700
commit1d4b5b6fd2433a10cc7ab87626cb560f54b0acbb (patch)
tree6196d519190720fd2968ac7d4b373e3c967d5fe6 /source/slang/slang-ast-type.cpp
parent355bb4287861f96082751042f4e58ff3598b4e5e (diff)
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 <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ast-type.cpp')
-rw-r--r--source/slang/slang-ast-type.cpp10
1 files changed, 10 insertions, 0 deletions
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<DeclRefType>(type);
+ if (!declRefType)
+ return false;
+ if (declRefType->getDeclRef().getDecl()->findModifier<NonCopyableTypeAttribute>())
+ return true;
+ return false;
+}
+
} // namespace Slang