summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir.h
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2025-07-09 14:41:19 +0800
committerGitHub <noreply@github.com>2025-07-09 06:41:19 +0000
commit00746bf09047cdf01c19dac513a532bcf3ed3ea3 (patch)
tree3424872a629307fc9fb4dc04ea5e9a0a787a6523 /source/slang/slang-ir.h
parent4f54cccf0e0e06be38312e2ee97c2b50b82d7c10 (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/slang-ir.h')
-rw-r--r--source/slang/slang-ir.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/source/slang/slang-ir.h b/source/slang/slang-ir.h
index c29a52ff7..712763e86 100644
--- a/source/slang/slang-ir.h
+++ b/source/slang/slang-ir.h
@@ -2357,8 +2357,10 @@ struct IRAnalysis
IRDominatorTree* getDominatorTree();
};
+FIDDLE()
struct IRModule : RefObject
{
+ FIDDLE(...)
public:
enum
{
@@ -2441,9 +2443,28 @@ public:
ContainerPool& getContainerPool() { return m_containerPool; }
+ //
+ // The range of module versions this compiler supports
+ //
+ // This will need to be updated if for example an instruction is removed,
+ // the max supported version should be incremented and the min supported
+ // version set to above the last version an instance of that instruction
+ // could be found
+ //
+ // Additionally this should be updated when new instructions are added,
+ // however only k_maxSupportedModuleVersion needs to be incremented in that
+ // case
+ //
+ // It represents the version of module regarding semantics and doesn't have
+ // anything to do with serialization format
+ //
+ const static UInt k_minSupportedModuleVersion = 0;
+ const static UInt k_maxSupportedModuleVersion = 0;
+
private:
friend struct IRSerialReadContext;
friend struct IRSerialWriteContext;
+ friend struct Fossilized_IRModule;
IRModule() = delete;
@@ -2463,10 +2484,13 @@ private:
/// instructions from an arbitrary IR instruction we expect to find the
/// `IRModuleInst` for the module the instruction belongs to, if any.
///
- IRModuleInst* m_moduleInst = nullptr;
+ FIDDLE() IRModuleInst* m_moduleInst = nullptr;
// The name of the module.
- Name* m_name = nullptr;
+ FIDDLE() Name* m_name = nullptr;
+
+ // The version of the module as it was loaded
+ FIDDLE() UInt m_version = k_maxSupportedModuleVersion;
/// The memory arena from which all IR instructions (and any associated state) in this module
/// are allocated.