From c985f5f2f95dc95998fdfb8400baa0a04760ada2 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 5 Nov 2020 13:43:00 -0500 Subject: Standard library save/loadable (#1592) * #include an absolute path didn't work - because paths were taken to always be relative. * Fix handling of access modifiers inside type definition. * Fix access problem for AST node. Make dumping produce a single function with switch, to potentially make available without Dump specific access. * WIP on serialization design doc. * Remove project references to previously generated files. * More docs on serialization design. * Improve serialization documentation. Remove unused function from IRSerialReader. * Small fixes around naming. Remove long comment from slang-serialize.h - as covered in serialization.md * Remove long comment in slang-serialize.h as covered in serialization.md * More information about doing replacements on read for AST and problems surrounding. * Typo fix. * Spelling fixes. * Value serialize. * Value types with inheritence. * Use value reflection serial conversion for more AST types * Use automatic serialization on more of AST. * Get the types via decltype, simplifies what the extractor has to do. * Update the serialization.md for the value serialization. * Small doc improvements. * Update project. * Remove ImportExternalDecl type Added addImportSymbol and ImportSymbol type Fixed bug in container which meant it wouldn't read back AST module * Because of change of how imports and handled, store objects as SerialPointers. * First pass symbol lookup from mangled names. * Cache current module looked up from mangled name. * Fix SourceLoc bug. Improve comments. * Added diagnostic on mangled symbol not being found * Fix typo. * WIP serializing stdlib. * WIP serializing stdlib in. * Fix problem serializing arrays that hold data that is already serialized. * Remove clash of names in MagicTypeModifier. * Make conversion from char to String explicit. Fix reference count issue with SerialReader. * Add code to save/load stdlib. * Use return code to avoid warning - SerialContainerUtil::write(module, options, &stream)) * Make all String numeric ctors explicit. Added isChar to UnownedStringSlice. Added operator== for UnownedStringSlice to String to avoid need to convert to String and allocate. * Add error check to readAllText. * tabs -> spaces on String.h * tab -> spaces String.cpp * Remove msg for StringBuilder, just build inplace for exceptions. * Check SerialClasses - for name clashes. Renamed Modifier::name as Modifier::keywordName * Handling of extensions when deserializing AST - updating the moduleDecl->mapTypeToCandidateExtensions Co-authored-by: Tim Foley --- source/slang/slang-check-modifier.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/slang/slang-check-modifier.cpp') diff --git a/source/slang/slang-check-modifier.cpp b/source/slang/slang-check-modifier.cpp index b38018354..4594af28d 100644 --- a/source/slang/slang-check-modifier.cpp +++ b/source/slang/slang-check-modifier.cpp @@ -395,7 +395,7 @@ namespace Slang // Let it go thru iff single string attribute if (!hasStringArgs(attr, 1)) { - getSink()->diagnose(attr, Diagnostics::expectedSingleStringArg, attr->name); + getSink()->diagnose(attr, Diagnostics::expectedSingleStringArg, attr->keywordName); } } else if (as(attr)) @@ -403,7 +403,7 @@ namespace Slang // Let it go thru iff single integral attribute if (!hasIntArgs(attr, 1)) { - getSink()->diagnose(attr, Diagnostics::expectedSingleIntArg, attr->name); + getSink()->diagnose(attr, Diagnostics::expectedSingleIntArg, attr->keywordName); } } else if (as(attr)) @@ -433,7 +433,7 @@ namespace Slang } else { - getSink()->diagnose(attr, Diagnostics::expectedSingleIntArg, attr->name); + getSink()->diagnose(attr, Diagnostics::expectedSingleIntArg, attr->keywordName); return false; } } @@ -551,7 +551,7 @@ namespace Slang UncheckedAttribute* uncheckedAttr, ModifiableSyntaxNode* attrTarget) { - auto attrName = uncheckedAttr->getName(); + auto attrName = uncheckedAttr->getKeywordName(); auto attrDecl = lookUpAttributeDecl( attrName, uncheckedAttr->scope); @@ -580,7 +580,7 @@ namespace Slang // We are going to replace the unchecked attribute with the checked one. // First copy all of the state over from the original attribute. - attr->name = uncheckedAttr->name; + attr->keywordName = uncheckedAttr->keywordName; attr->args = uncheckedAttr->args; attr->loc = uncheckedAttr->loc; -- cgit v1.2.3