From 9773495f1ab8a11194a21e1cf7b141c3da5cdfce Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 29 May 2020 14:26:48 -0400 Subject: NodeBase types constructed with astNodeType member set (#1363) * Maked Substituions derived from NodeBase * * Add astNodeTYpe field to NodeBase * Make Substitutions derived from NodeBase * Make all construction through ASTBuilder * Make getClassInfo non virtual (just uses the astNodeType) --- source/slang/slang-ast-reflect.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 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 7efccd3e4..689d9d93f 100644 --- a/source/slang/slang-ast-reflect.cpp +++ b/source/slang/slang-ast-reflect.cpp @@ -23,7 +23,6 @@ static ReflectClassInfo::Infos _calcInfos() ReflectClassInfo::Infos infos; memset(&infos, 0, sizeof(infos)); SLANG_ALL_ASTNode_NodeBase(SLANG_REFLECT_GET_REFLECT_CLASS_INFO, _) - SLANG_ALL_ASTNode_Substitutions(SLANG_REFLECT_GET_REFLECT_CLASS_INFO, _) return infos; } @@ -49,7 +48,7 @@ struct ASTConstructAccess template struct CreateImpl { - static void* create() { return new T; } + static void* create(ASTBuilder* astBuilder) { return astBuilder->create(); } }; }; @@ -68,7 +67,6 @@ struct ASTConstructAccess /* static */const ReflectClassInfo NAME::kReflectClassInfo = { uint32_t(ASTNodeType::NAME), uint32_t(ASTNodeType::LAST), SLANG_GET_SUPER_##TYPE(SUPER), #NAME, SLANG_GET_CREATE_FUNC_##MARKER(NAME) }; SLANG_ALL_ASTNode_NodeBase(SLANG_REFLECT_CLASS_INFO, _) -SLANG_ALL_ASTNode_Substitutions(SLANG_REFLECT_CLASS_INFO, _) // We dispatch to non 'abstract' types #define SLANG_CASE_NONE(NAME) case ASTNodeType::NAME: return visitor->dispatch_##NAME(static_cast(this), extra); -- cgit v1.2.3