diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2020-06-05 10:00:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-05 10:00:29 -0700 |
| commit | 00db8212b3266dfc6f3b1fba2d0f1f0c6fe5ec95 (patch) | |
| tree | 070f9a3a27796d6edf4f905a3bfbd43a73f06338 /source/slang/slang-ast-builder.cpp | |
| parent | 899824eb3dbb327f3fd8479ca9bc01f8ea49ed98 (diff) | |
| parent | 3bb780724830ae830657a47e4eba008a4c0f4ff7 (diff) | |
Merge branch 'master' into loop_attrib
Diffstat (limited to 'source/slang/slang-ast-builder.cpp')
| -rw-r--r-- | source/slang/slang-ast-builder.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/slang/slang-ast-builder.cpp b/source/slang/slang-ast-builder.cpp index 316390353..67ce80120 100644 --- a/source/slang/slang-ast-builder.cpp +++ b/source/slang/slang-ast-builder.cpp @@ -21,18 +21,20 @@ void SharedASTBuilder::init(Session* session) m_session = session; // We just want as a place to store allocations of shared types - RefPtr<ASTBuilder> astBuilder(new ASTBuilder); - - astBuilder->m_sharedASTBuilder = this; + { + RefPtr<ASTBuilder> astBuilder(new ASTBuilder); + astBuilder->m_sharedASTBuilder = this; + m_astBuilder = astBuilder.detach(); + } + // Clear the built in types memset(m_builtinTypes, 0, sizeof(m_builtinTypes)); + // Create common shared types m_errorType = m_astBuilder->create<ErrorType>(); m_initializerListType = m_astBuilder->create<InitializerListType>(); m_overloadedType = m_astBuilder->create<OverloadGroupType>(); - m_astBuilder = astBuilder.detach(); - // We can just iterate over the class pointers. // NOTE! That this adds the names of the abstract classes too(!) for (Index i = 0; i < Index(ASTNodeType::CountOf); ++i) |
