From 65c2e7f1ccc6cdb5daec343c7e32b4a9dc463ae4 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 12 Apr 2022 15:23:53 -0700 Subject: Support `[DllImport]` (#2181) * Support `[DllImport]` * Fix. * Fix. * Fix array type emit in cpp. * Fix. * Fix. * Fix Co-authored-by: Yong He --- source/slang/slang-ast-builder.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/slang/slang-ast-builder.cpp') 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(nullPtrTypeDecl)); + } + return m_nullPtrType; +} + SharedASTBuilder::~SharedASTBuilder() { // Release built in types.. -- cgit v1.2.3