summaryrefslogtreecommitdiff
path: root/source/slang/slang-ast-reflect.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-05-29 14:26:48 -0400
committerGitHub <noreply@github.com>2020-05-29 14:26:48 -0400
commit9773495f1ab8a11194a21e1cf7b141c3da5cdfce (patch)
tree67031b547c61fba8553aee44b627b05eeeb4c4ee /source/slang/slang-ast-reflect.cpp
parent45e414f9298d9fae339ff61a959f30b0529c41b9 (diff)
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)
Diffstat (limited to 'source/slang/slang-ast-reflect.cpp')
-rw-r--r--source/slang/slang-ast-reflect.cpp4
1 files changed, 1 insertions, 3 deletions
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 <typename T>
struct CreateImpl
{
- static void* create() { return new T; }
+ static void* create(ASTBuilder* astBuilder) { return astBuilder->create<T>(); }
};
};
@@ -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<NAME*>(this), extra);