From ae41db80aa95ee7243d91a3ae4f56e6deb17f7f4 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 24 Jun 2020 13:56:06 -0400 Subject: AST Serialization writing (#1407) * Try to fix problem with C++ extractor concating tokens producing an erroneous result. * Improve naming/comments around C++ extractor fix. * Another small improvement around space concating when outputing token list. * Handle some more special cases for consecutive tokens for C++ extractor concat of tokens. * WIP AST serialization. * Comment out so compile works. * More work on AST serialization. * WIP AST serialize. * WIP AST Serialization - handling more types. * WIP: Compiles but not all types are converted, as not all List element types are handled. * Compiles with array types. * Finish off AST serialization of remaining types. * Remove ComputedLayoutModifier and TupleVarModifier. * Add fields to ASTSerialClass type. * Construct AST type layout. * AST Serialization working for writing to ASTSerialWriter. * Removed call to ASTSerialization::selfTest in session creation. * Fixes for gcc. * Diagnostics handling - better handling of dashify. * Improve comment around DiagnosticLookup. * Updated VS project. --- source/slang/slang.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 5279b2a40..7c535d64b 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -15,6 +15,7 @@ #include "slang-type-layout.h" #include "slang-ast-dump.h" +#include "slang-ast-serialize.h" #include "slang-repro.h" @@ -1074,6 +1075,18 @@ void FrontEndCompileRequest::parseTranslationUnit( File::writeAllText(fileName, writer.getContent()); } } + +#if 0 + // Test serialization + { + RefPtr classes = new ASTSerialClasses; + ASTSerialWriter writer(classes); + + // Lets serialize it all + writer.addPointer(translationUnit->getModuleDecl()); + } +#endif + } } -- cgit v1.2.3