diff options
| author | Yong He <yonghe@outlook.com> | 2020-08-05 10:32:52 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-05 10:32:52 -0700 |
| commit | 6fb2aa70a2681bffbac7e8de67e9598105389945 (patch) | |
| tree | f89cb433e7498bf74292bf460096f1129ef3ac13 /source/slang/slang-ir.cpp | |
| parent | 092337a67e7ef8ec108cab9cb6679e59bb2ff791 (diff) | |
`AnyValue` based dynamic dispatch code gen (#1477)
* AnyValue based dynamic code gen
* Fix aarch64 build error
Diffstat (limited to 'source/slang/slang-ir.cpp')
| -rw-r--r-- | source/slang/slang-ir.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
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<IRNameHintDecoration>()) + 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<IRPackAnyValue>( + this, + kIROp_PackAnyValue, + type, + value); + + addInst(inst); + return inst; + } + + IRInst* IRBuilder::emitUnpackAnyValue(IRType* type, IRInst* value) + { + auto inst = createInst<IRPackAnyValue>( + this, + kIROp_UnpackAnyValue, + type, + value); + + addInst(inst); + return inst; + } + IRInst* IRBuilder::emitCallInst( IRType* type, IRInst* pFunc, |
