summaryrefslogtreecommitdiff
path: root/source/slang/slang-ast-decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ast-decl.cpp')
-rw-r--r--source/slang/slang-ast-decl.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/slang/slang-ast-decl.cpp b/source/slang/slang-ast-decl.cpp
index 2f1c7c47e..9dbd006a0 100644
--- a/source/slang/slang-ast-decl.cpp
+++ b/source/slang/slang-ast-decl.cpp
@@ -4,6 +4,7 @@
#include <assert.h>
#include "slang-generated-ast-macro.h"
+#include "slang-ast-decl.h"
namespace Slang {
@@ -118,4 +119,21 @@ bool isLocalVar(const Decl* decl)
return false;
}
+ThisTypeDecl* InterfaceDecl::getThisTypeDecl()
+{
+ for (auto member : members)
+ {
+ if (auto thisTypeDeclCandidate = as<ThisTypeDecl>(member))
+ {
+ return thisTypeDeclCandidate;
+ }
+ }
+ SLANG_UNREACHABLE("InterfaceDecl does not have a ThisType decl.");
+}
+
+InterfaceDecl* ThisTypeConstraintDecl::getInterfaceDecl()
+{
+ return as<InterfaceDecl>(parentDecl->parentDecl);
+}
+
} // namespace Slang