From c2d31347ea06c768045e7c503ef0188e0e5356de Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 28 May 2020 14:01:51 -0400 Subject: WIP: ASTBuilder (#1358) * Compiles. * Small tidy up around session/ASTBuilder. * Tests are now passing. * Fix Visual Studio project. * Fix using new X to use builder when protectedness of Ctor is not enough. Substitute->substitute * Add some missing ast nodes created outside of ASTBuilder. * Compile time check that ASTBuilder is making an AST type. * Moced findClasInfo and findSyntaxClass (essentially the same thing) to SharedASTBuilder from Session. --- source/slang/slang-ast-reflect.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source/slang/slang-ast-reflect.cpp') diff --git a/source/slang/slang-ast-reflect.cpp b/source/slang/slang-ast-reflect.cpp index eb511689d..7efccd3e4 100644 --- a/source/slang/slang-ast-reflect.cpp +++ b/source/slang/slang-ast-reflect.cpp @@ -44,11 +44,13 @@ bool ReflectClassInfo::isSubClassOfSlow(const ThisType& super) const // Now try and implement all of the classes // Macro generated is of the format - -template -struct CreateImpl +struct ASTConstructAccess { - static void* create() { return new T; } + template + struct CreateImpl + { + static void* create() { return new T; } + }; }; #define SLANG_GET_SUPER_BASE(SUPER) nullptr @@ -56,10 +58,10 @@ struct CreateImpl #define SLANG_GET_SUPER_LEAF(SUPER) &SUPER::kReflectClassInfo #define SLANG_GET_CREATE_FUNC_ABSTRACT(NAME) nullptr -#define SLANG_GET_CREATE_FUNC_NONE(NAME) &CreateImpl::create +#define SLANG_GET_CREATE_FUNC_NONE(NAME) &ASTConstructAccess::CreateImpl::create #define SLANG_GET_CREATE_FUNC_NON_VISITOR_ABSTRACT(NAME) nullptr -#define SLANG_GET_CREATE_FUNC_NON_VISITOR(NAME) &CreateImpl::create +#define SLANG_GET_CREATE_FUNC_NON_VISITOR(NAME) &ASTConstructAccess::CreateImpl::create #define SLANG_REFLECT_CLASS_INFO(NAME, SUPER, ORIGIN, LAST, MARKER, TYPE, param) \ -- cgit v1.2.3