summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-syntax.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-12-01 18:55:43 -0800
committerGitHub <noreply@github.com>2022-12-01 18:55:43 -0800
commite7df8538eb8f0ed06f0838d946bec8e9e0fe0985 (patch)
tree3c08e646600ab82ffda260f2b6deb96dd2085776 /source/slang/slang-syntax.cpp
parentf51f69d045d9e0b83d9ab1f4623d4319ce1867be (diff)
Allow `no_diff` on `this` parameter. (#2543)
Diffstat (limited to 'source/slang/slang-syntax.cpp')
-rw-r--r--source/slang/slang-syntax.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/slang/slang-syntax.cpp b/source/slang/slang-syntax.cpp
index a79c48227..4e5db17c0 100644
--- a/source/slang/slang-syntax.cpp
+++ b/source/slang/slang-syntax.cpp
@@ -1368,6 +1368,14 @@ Module* getModule(Decl* decl)
return moduleDecl->module;
}
+Decl* getParentDecl(Decl* decl)
+{
+ decl = decl->parentDecl;
+ while (as<GenericDecl>(decl))
+ decl = decl->parentDecl;
+ return decl;
+}
+
static const ImageFormatInfo kImageFormatInfos[] =
{
#define SLANG_IMAGE_FORMAT_INFO(TYPE, COUNT, SIZE) SLANG_SCALAR_TYPE_##TYPE, uint8_t(COUNT), uint8_t(SIZE)