summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-11-07 19:03:52 -0800
committerGitHub <noreply@github.com>2023-11-07 19:03:52 -0800
commit0f2578d7b3e75c0e5ef724ffe610d004fb116a03 (patch)
treed8bbe837a35377a64508b0c34c34feb6da43e02e /source/slang/slang-ir.cpp
parent421941993d169c943f2c364bfe9c48b603339fd1 (diff)
Add `IRThisTypeWitness` to stand in for witness lookups inside an interface definition. (#3316)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir.cpp')
-rw-r--r--source/slang/slang-ir.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp
index 2f603ac17..c40a62941 100644
--- a/source/slang/slang-ir.cpp
+++ b/source/slang/slang-ir.cpp
@@ -4381,6 +4381,17 @@ namespace Slang
return entry;
}
+ IRInst* IRBuilder::createThisTypeWitness(IRType* interfaceType)
+ {
+ IRInst* witness = createInst<IRThisTypeWitness>(
+ this,
+ kIROp_ThisTypeWitness,
+ getWitnessTableType(interfaceType));
+ addGlobalValue(this, witness);
+ return witness;
+ }
+
+
IRStructType* IRBuilder::createStructType()
{
IRStructType* structType = createInst<IRStructType>(
@@ -7691,6 +7702,7 @@ namespace Slang
case kIROp_GlobalParam:
case kIROp_StructKey:
case kIROp_GlobalGenericParam:
+ case kIROp_ThisTypeWitness:
case kIROp_WitnessTable:
case kIROp_WitnessTableEntry:
case kIROp_InterfaceRequirementEntry: