summaryrefslogtreecommitdiff
path: root/source/slang/slang-ast-dump.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-dump.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-dump.cpp')
-rw-r--r--source/slang/slang-ast-dump.cpp31
1 files changed, 6 insertions, 25 deletions
diff --git a/source/slang/slang-ast-dump.cpp b/source/slang/slang-ast-dump.cpp
index 8b9f643dd..2157b7c19 100644
--- a/source/slang/slang-ast-dump.cpp
+++ b/source/slang/slang-ast-dump.cpp
@@ -545,8 +545,13 @@ struct Context
m_writer->emit("\n");
}
+ void dump(ASTNodeType nodeType)
+ {
+ SLANG_UNUSED(nodeType)
+ // Don't bother to output anything - as will already have been dumped with the object name
+ }
+
void dumpObjectFull(NodeBase* node);
- void dumpObjectFull(Substitutions* subs);
Context(SourceWriter* writer, ASTDumpUtil::Style dumpStyle):
m_writer(writer),
@@ -585,7 +590,6 @@ static void dumpFields_##NAME(NAME* node, Context& context) \
SLANG_FIELDS_ASTNode_##NAME(SLANG_AST_DUMP_FIELD, _) \
}
-SLANG_ALL_ASTNode_Substitutions(SLANG_AST_DUMP_FIELDS_IMPL, _)
SLANG_ALL_ASTNode_NodeBase(SLANG_AST_DUMP_FIELDS_IMPL, _)
};
@@ -599,7 +603,6 @@ struct DumpFieldFuncs
DumpFieldFuncs()
{
memset(m_funcs, 0, sizeof(m_funcs));
- SLANG_ALL_ASTNode_Substitutions(SLANG_AST_GET_DUMP_FUNC, _)
SLANG_ALL_ASTNode_NodeBase(SLANG_AST_GET_DUMP_FUNC, _)
}
@@ -679,20 +682,6 @@ void Context::dumpObjectFull(NodeBase* node)
}
}
-void Context::dumpObjectFull(Substitutions* subs)
-{
- if (!subs)
- {
- _dumpPtr(nullptr);
- }
- else
- {
- const ReflectClassInfo& typeInfo = subs->getClassInfo();
- Index index = getObjectIndex(typeInfo, subs);
- dumpObjectFull(typeInfo, subs, index);
- }
-}
-
/* static */void ASTDumpUtil::dump(NodeBase* node, Style style, SourceWriter* writer)
{
Context context(writer, style);
@@ -700,12 +689,4 @@ void Context::dumpObjectFull(Substitutions* subs)
context.dumpRemaining();
}
-/* static */void ASTDumpUtil::dump(Substitutions* subs, Style style, SourceWriter* writer)
-{
- Context context(writer, style);
- context.dumpObjectFull(subs);
- context.dumpRemaining();
-
-}
-
} // namespace Slang