summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2020-08-18 13:08:45 -0700
committerGitHub <noreply@github.com>2020-08-18 13:08:45 -0700
commitb820f34a1b6336af184458c5b1dfe2273c99f1ff (patch)
treeca9986891127cfe07eda18bfbdb5094eef5677cc /source/slang/slang-ir.cpp
parent9abcb6ea24dbc7184c3a2ad9f4458f63f8901928 (diff)
Support initializing an existential value from a generic value. (#1503)
* Support initializing an existential value from a generic value. * Remove trailing spaces and clean up debugging code.
Diffstat (limited to 'source/slang/slang-ir.cpp')
-rw-r--r--source/slang/slang-ir.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp
index 2a1db6310..c5943da3c 100644
--- a/source/slang/slang-ir.cpp
+++ b/source/slang/slang-ir.cpp
@@ -2790,6 +2790,16 @@ namespace Slang
return emitIntrinsicInst(type, kIROp_MakeExistential, SLANG_COUNT_OF(args), args);
}
+ IRInst* IRBuilder::emitMakeExistentialWithRTTI(
+ IRType* type,
+ IRInst* value,
+ IRInst* witnessTable,
+ IRInst* rtti)
+ {
+ IRInst* args[] = { value, witnessTable, rtti };
+ return emitIntrinsicInst(type, kIROp_MakeExistentialWithRTTI, SLANG_COUNT_OF(args), args);
+ }
+
IRInst* IRBuilder::emitWrapExistential(
IRType* type,
IRInst* value,