summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ast-builder.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-04-12 15:23:53 -0700
committerGitHub <noreply@github.com>2022-04-12 15:23:53 -0700
commit65c2e7f1ccc6cdb5daec343c7e32b4a9dc463ae4 (patch)
treeb13a93f5fa621a50ce3c100f018730c882ca3e9c /source/slang/slang-ast-builder.cpp
parent89560d62f3fb42e0f76cbae76c23eac437b65eba (diff)
Support `[DllImport]` (#2181)
* Support `[DllImport]` * Fix. * Fix. * Fix array type emit in cpp. * Fix. * Fix. * Fix Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ast-builder.cpp')
-rw-r--r--source/slang/slang-ast-builder.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/slang/slang-ast-builder.cpp b/source/slang/slang-ast-builder.cpp
index 8e1813df3..caf4c020d 100644
--- a/source/slang/slang-ast-builder.cpp
+++ b/source/slang/slang-ast-builder.cpp
@@ -110,6 +110,16 @@ Type* SharedASTBuilder::getDynamicType()
return m_dynamicType;
}
+Type* SharedASTBuilder::getNullPtrType()
+{
+ if (!m_nullPtrType)
+ {
+ auto nullPtrTypeDecl = findMagicDecl("NullPtrType");
+ m_nullPtrType = DeclRefType::create(m_astBuilder, makeDeclRef<Decl>(nullPtrTypeDecl));
+ }
+ return m_nullPtrType;
+}
+
SharedASTBuilder::~SharedASTBuilder()
{
// Release built in types..