diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-10-29 11:45:56 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-29 08:45:56 -0700 |
| commit | 494e09af2cebafa34db49dc1f60afd43aebed619 (patch) | |
| tree | b3985b21d4470415a3ad1a6183836528a971ca54 /source/slang/slang-compiler.h | |
| parent | 1d7a7f23874151372f2792e7307f50c54dae877f (diff) | |
Handling imported/exporting symbols from serialized modules (#1589)
* #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.
Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-compiler.h')
| -rwxr-xr-x | source/slang/slang-compiler.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source/slang/slang-compiler.h b/source/slang/slang-compiler.h index 79ef9df27..56885ab46 100755 --- a/source/slang/slang-compiler.h +++ b/source/slang/slang-compiler.h @@ -973,6 +973,10 @@ namespace Slang List<Module*> const& getModuleDependencies() SLANG_OVERRIDE { return m_moduleDependencyList.getModuleList(); } List<String> const& getFilePathDependencies() SLANG_OVERRIDE { return m_filePathDependencyList.getFilePathList(); } + /// Given a mangled name finds the exported NodeBase associated with this module. + /// If not found returns nullptr. + NodeBase* findExportFromMangledName(const UnownedStringSlice& slice); + /// Get the ASTBuilder ASTBuilder* getASTBuilder() { return &m_astBuilder; } @@ -1004,6 +1008,7 @@ namespace Slang List<RefPtr<EntryPoint>> const& getEntryPoints() { return m_entryPoints; } void _addEntryPoint(EntryPoint* entryPoint); + void _processFindDeclsExportSymbolsRec(Decl* decl); protected: void acceptVisitor(ComponentTypeVisitor* visitor, SpecializationInfo* specializationInfo) SLANG_OVERRIDE; @@ -1054,6 +1059,11 @@ namespace Slang // The builder that owns all of the AST nodes from parsing the source of // this module. ASTBuilder m_astBuilder; + + // Holds map of exported mangled names to symbols. m_mangledExportPool maps names to indices, + // and m_mangledExportSymbols holds the NodeBase* values for each index. + StringSlicePool m_mangledExportPool; + List<NodeBase*> m_mangledExportSymbols; }; typedef Module LoadedModule; @@ -1234,7 +1244,7 @@ namespace Slang SlangMatrixLayoutMode mode); /// Create an initially-empty linkage - Linkage(Session* session, ASTBuilder* astBuilder); + Linkage(Session* session, ASTBuilder* astBuilder, Linkage* builtinLinkage); /// Dtor ~Linkage(); @@ -2137,6 +2147,9 @@ namespace Slang /// Get the prelude associated with the language const String& getPreludeForLanguage(SourceLanguage language) { return m_languagePreludes[int(language)]; } + /// Get the built in linkage -> handy to get the stdlibs from + Linkage* getBuiltinLinkage() const { return m_builtinLinkage; } + void init(); void addBuiltinSource( |
