diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-11-18 14:52:58 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-18 14:52:58 -0500 |
| commit | d898d561e3c76ecf38db434ec7fbb4bbd0e25cb2 (patch) | |
| tree | 7d92bcf80430a6d3e065aac9fc06a2c44b1cf5fa /source/slang/slang-serialize-factory.cpp | |
| parent | bdc589b0b1360cd06c48f88a117c55e84198ab23 (diff) | |
Serialized stdlib working (#1603)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Mangling/module name extraction for GenericDecl
* Add comment on SerialFilter to explain re-enabling Stmt.
* Support setting up SyntaxDecl when reconstructed after deserialization.
* Improvements to setup SyntaxDecl.
* Fix typo so can read compressed SourceLocs.
* Fix issue with SourceManger.
Diffstat (limited to 'source/slang/slang-serialize-factory.cpp')
| -rw-r--r-- | source/slang/slang-serialize-factory.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/slang/slang-serialize-factory.cpp b/source/slang/slang-serialize-factory.cpp index 3ff536137..9b3ba9994 100644 --- a/source/slang/slang-serialize-factory.cpp +++ b/source/slang/slang-serialize-factory.cpp @@ -86,6 +86,16 @@ SerialIndex ModuleSerialFilter::writePointer(SerialWriter* writer, const NodeBas } } + // TODO(JS): If I enable this section then the stdlib doesn't work correctly, it appears to be because of + // `addCatchAllIntrinsicDecorationIfNeeded`. If this is enabled when AST is serialized, the 'body' (ie Stmt) + // will not be serialized. When serialized back in, it will appear to be a function without a body. + // In that case `addCatchAllIntrinsicDecorationIfNeeded` will add an intrinsic which in some cases is incorrect. + // This happens during lowering. + // + // So it seems the fix is for some other mechanism. Another solution is perhaps to run something like `addCatchAllIntrinsicDecorationIfNeeded` + // on the stdlib after compilation, and before serialization. Then removing it from lowering. + +#if 0 // TODO(JS): What we really want to do here is to ignore bodies functions. // It's not 100% clear if this is even right though - for example does type inference // imply the body is needed to say infer a return type? @@ -99,6 +109,7 @@ SerialIndex ModuleSerialFilter::writePointer(SerialWriter* writer, const NodeBas writer->setPointerIndex(stmt, SerialIndex(0)); return SerialIndex(0); } +#endif // For now for everything else just write it return writer->writeObject(ptr); |
