summaryrefslogtreecommitdiff
path: root/source/slang/slang-ast-base.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-11-05 13:43:00 -0500
committerGitHub <noreply@github.com>2020-11-05 13:43:00 -0500
commitc985f5f2f95dc95998fdfb8400baa0a04760ada2 (patch)
treef79ba0576dd4f85c284f3c300a42d79964413796 /source/slang/slang-ast-base.h
parent8d4c0ea875b186648ff75b4f04891ba8f1286aac (diff)
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 <tim.foley.is@gmail.com>
Diffstat (limited to 'source/slang/slang-ast-base.h')
-rw-r--r--source/slang/slang-ast-base.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/slang/slang-ast-base.h b/source/slang/slang-ast-base.h
index e9005212c..2bfa7940b 100644
--- a/source/slang/slang-ast-base.h
+++ b/source/slang/slang-ast-base.h
@@ -155,6 +155,8 @@ class Type: public Val
bool _equalsImplOverride(Type* type);
Type* _createCanonicalTypeOverride();
+ void _setASTBuilder(ASTBuilder* astBuilder) { m_astBuilder = astBuilder; }
+
protected:
bool equalsImpl(Type* type);
Type* createCanonicalType();
@@ -276,10 +278,10 @@ class Modifier : public SyntaxNode
Modifier* next = nullptr;
// The keyword that was used to introduce t that was used to name this modifier.
- Name* name = nullptr;
+ Name* keywordName = nullptr;
- Name* getName() { return name; }
- NameLoc getNameAndLoc() { return NameLoc(name, loc); }
+ Name* getKeywordName() { return keywordName; }
+ NameLoc getKeywordNameAndLoc() { return NameLoc(keywordName, loc); }
};
// A syntax node which can have modifiers applied
@@ -327,7 +329,6 @@ public:
SourceLoc getNameLoc() { return nameAndLoc.loc ; }
NameLoc getNameAndLoc() { return nameAndLoc ; }
-
DeclCheckStateExt checkState = DeclCheckState::Unchecked;
// The next declaration defined in the same container with the same name