summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-decl.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2021-07-09 16:29:23 -0400
committerGitHub <noreply@github.com>2021-07-09 16:29:23 -0400
commit7b447bdad29c828b49ba63cefacc677bd7c58b28 (patch)
treebb69105c92241b0b8296961cc0a301134a854bbf /source/slang/slang-check-decl.cpp
parentfa565f96823f3985cffa3a899742fdf1449d5876 (diff)
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.
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
-rw-r--r--source/slang/slang-check-decl.cpp8
1 files changed, 3 insertions, 5 deletions
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<Scope>();
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<Scope>();
subScope->containerDecl = namespaceDecl;
subScope->nextSibling = scope->nextSibling;
scope->nextSibling = subScope;