From 5a623ec227726ad1d988a5d91f55f19b62a98e03 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 15 Feb 2024 00:05:51 -0800 Subject: Support loading serialized modules. (#3588) * Support loading serialized modules. * Fix. * Fix vs solution files * Fix glsl module loading. * C++ fix. * Fix. * Try fix c++ error. * Try fix. * Fix. * Fix. --- source/slang/slang-check-decl.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source/slang/slang-check-decl.cpp') diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp index 2a6ee8abc..f1409efe1 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -820,6 +820,11 @@ namespace Slang return as(parentDecl) != nullptr || as(parentDecl) != nullptr; } + bool isUnsafeForceInlineFunc(FunctionDeclBase* funcDecl) + { + return funcDecl->hasModifier(); + } + /// Is `decl` a global shader parameter declaration? bool isGlobalShaderParameter(VarDeclBase* decl) { @@ -7302,7 +7307,7 @@ namespace Slang { // Create a new sub-scope to wire the module // into our lookup chain. - addSiblingScopeForContainerDecl(scope, fileDecl); + addSiblingScopeForContainerDecl(getASTBuilder(), scope, fileDecl); } void SemanticsVisitor::importModuleIntoScope(Scope* scope, ModuleDecl* moduleDecl) @@ -7325,7 +7330,7 @@ namespace Slang if (moduleScope->containerDecl != moduleDecl && moduleScope->containerDecl->parentDecl != moduleDecl) continue; - addSiblingScopeForContainerDecl(scope, moduleScope->containerDecl); + addSiblingScopeForContainerDecl(getASTBuilder(), scope, moduleScope->containerDecl); } // Also import any modules from nested `import` declarations @@ -7547,7 +7552,7 @@ namespace Slang if (addedScopes.add(s->containerDecl)) { scopesAdded = true; - addSiblingScopeForContainerDecl(scope, s->containerDecl); + addSiblingScopeForContainerDecl(getASTBuilder(), scope, s->containerDecl); } } }; @@ -7608,7 +7613,7 @@ namespace Slang { ensureDecl(ns, DeclCheckState::ScopesWired); } - addSiblingScopeForContainerDecl(decl, otherNamespace); + addSiblingScopeForContainerDecl(getASTBuilder(), decl, otherNamespace); } } // For file decls, we need to continue searching up in the parent module scope. -- cgit v1.2.3