From 6fb2aa70a2681bffbac7e8de67e9598105389945 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 5 Aug 2020 10:32:52 -0700 Subject: `AnyValue` based dynamic dispatch code gen (#1477) * AnyValue based dynamic code gen * Fix aarch64 build error --- source/slang/slang-ir.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'source/slang/slang-ir.cpp') diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index fcb039d25..2c9aee817 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -17,6 +17,12 @@ namespace Slang return inst->sourceLoc; } + void printDiagnosticArg(StringBuilder& sb, IRInst* irObject) + { + if (auto nameHint = irObject->findDecoration()) + sb << nameHint->getName(); + } + // !!!!!!!!!!!!!!!!!!!!!!!!!!!! DiagnosticSink Impls !!!!!!!!!!!!!!!!!!!!! IRInst* cloneGlobalValueWithLinkage( @@ -2612,6 +2618,30 @@ namespace Slang return inst; } + IRInst* IRBuilder::emitPackAnyValue(IRType* type, IRInst* value) + { + auto inst = createInst( + this, + kIROp_PackAnyValue, + type, + value); + + addInst(inst); + return inst; + } + + IRInst* IRBuilder::emitUnpackAnyValue(IRType* type, IRInst* value) + { + auto inst = createInst( + this, + kIROp_UnpackAnyValue, + type, + value); + + addInst(inst); + return inst; + } + IRInst* IRBuilder::emitCallInst( IRType* type, IRInst* pFunc, -- cgit v1.2.3