diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2025-07-09 14:41:19 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-09 06:41:19 +0000 |
| commit | 00746bf09047cdf01c19dac513a532bcf3ed3ea3 (patch) | |
| tree | 3424872a629307fc9fb4dc04ea5e9a0a787a6523 /source/slang-record-replay | |
| parent | 4f54cccf0e0e06be38312e2ee97c2b50b82d7c10 (diff) | |
Stable names and backwards compat for serialized IR modules (#7644)
* stable names
* tests, options and ci for stable names
* Add back compat design document
* fix warnings
* formatting
* comment
* neaten
* regenerate command line reference
* consolidate ci scripts
* faster ci
* remove libreadline
* Move new function to end of interface
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'source/slang-record-replay')
| -rw-r--r-- | source/slang-record-replay/record/slang-session.cpp | 33 | ||||
| -rw-r--r-- | source/slang-record-replay/record/slang-session.h | 5 |
2 files changed, 38 insertions, 0 deletions
diff --git a/source/slang-record-replay/record/slang-session.cpp b/source/slang-record-replay/record/slang-session.cpp index 800d690fa..254e1b091 100644 --- a/source/slang-record-replay/record/slang-session.cpp +++ b/source/slang-record-replay/record/slang-session.cpp @@ -92,6 +92,39 @@ SLANG_NO_THROW slang::IModule* SessionRecorder::loadModuleFromIRBlob( return static_cast<slang::IModule*>(pModuleRecorder); } +SLANG_NO_THROW SlangResult SLANG_MCALL SessionRecorder::loadModuleInfoFromIRBlob( + slang::IBlob* source, + SlangInt& outModuleVersion, + const char*& outModuleCompilerVersion, + const char*& outModuleName) +{ + slangRecordLog(LogLevel::Verbose, "%s\n", __PRETTY_FUNCTION__); + + ParameterRecorder* recorder{}; + { + recorder = m_recordManager->beginMethodRecord( + ApiCallId::ISession_loadModuleFromIRBlob, + m_sessionHandle); + recorder->recordPointer(source); + recorder = m_recordManager->endMethodRecord(); + } + + const auto result = m_actualSession->loadModuleInfoFromIRBlob( + source, + outModuleVersion, + outModuleCompilerVersion, + outModuleName); + + { + recorder->recordInt64(outModuleVersion); + recorder->recordString(outModuleCompilerVersion); + recorder->recordString(outModuleName); + m_recordManager->apendOutput(); + } + + return result; +} + SLANG_NO_THROW slang::IModule* SessionRecorder::loadModuleFromSource( const char* moduleName, const char* path, diff --git a/source/slang-record-replay/record/slang-session.h b/source/slang-record-replay/record/slang-session.h index 9cff7beac..26c591b1c 100644 --- a/source/slang-record-replay/record/slang-session.h +++ b/source/slang-record-replay/record/slang-session.h @@ -29,6 +29,11 @@ public: const char* path, slang::IBlob* source, slang::IBlob** outDiagnostics = nullptr) override; + SLANG_NO_THROW SlangResult SLANG_MCALL loadModuleInfoFromIRBlob( + slang::IBlob* source, + SlangInt& outModuleVersion, + const char*& outModuleCompilerVersion, + const char*& outModuleName) override; SLANG_NO_THROW slang::IModule* SLANG_MCALL loadModuleFromSource( const char* moduleName, const char* path, |
