From 7b447bdad29c828b49ba63cefacc677bd7c58b28 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 9 Jul 2021 16:29:23 -0400 Subject: Make Scope non ref counted (#1904) * Add debug symbols for release build. * Hack to try and capture failing compilation. * Typo fix for capture hack. * Specify return type on lambdas. * Added const. * Try breakpoint. * Up count * Let's capture everything so we can valgrind. * Disable always writing repros. * Make Scope non RefCounted. * Fix issue with not serializing Scope. * More comments around changes to Scope. Remove Scope* from serialization. * Remove code used for testing original issue. --- source/slang/slang-check-decl.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 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 0f6075903..dbbf7e973 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -4999,11 +4999,9 @@ namespace Slang importedModulesList.add(moduleDecl); importedModulesSet.Add(moduleDecl); - - // Create a new sub-scope to wire the module // into our lookup chain. - auto subScope = new Scope(); + auto subScope = getASTBuilder()->create(); subScope->containerDecl = moduleDecl; subScope->nextSibling = scope->nextSibling; @@ -5049,7 +5047,7 @@ namespace Slang // Add the declarations from the imported module into the scope // that the `import` declaration is set to extend. // - importModuleIntoScope(scope.Ptr(), importedModuleDecl); + importModuleIntoScope(scope, importedModuleDecl); // Record the `import`ed module (and everything it depends on) // as a dependency of the module we are compiling. @@ -5105,7 +5103,7 @@ namespace Slang // of entities than just namespaces. // auto scope = decl->scope; - auto subScope = new Scope(); + auto subScope = getASTBuilder()->create(); subScope->containerDecl = namespaceDecl; subScope->nextSibling = scope->nextSibling; scope->nextSibling = subScope; -- cgit v1.2.3