diff options
| author | Yong He <yonghe@outlook.com> | 2023-03-27 23:00:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-27 23:00:42 -0700 |
| commit | 0a6926003fd2300858e3089fe82f421543852395 (patch) | |
| tree | 19865fa9eb69373f0c0c16b7fac4993f67aa2b20 /source/slang/slang-emit-cpp.cpp | |
| parent | d120fec7e81bbd5e8cf2c551b573feaf6678b43d (diff) | |
Translate all composed types into tuple types in pyBind. (#2744)
* Translate all composed types into tuple types in pyBind.
* Delete temp file.
* Fix get tuple element code emit logic.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-emit-cpp.cpp')
| -rw-r--r-- | source/slang/slang-emit-cpp.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/slang/slang-emit-cpp.cpp b/source/slang/slang-emit-cpp.cpp index 346926712..a178dfe67 100644 --- a/source/slang/slang-emit-cpp.cpp +++ b/source/slang/slang-emit-cpp.cpp @@ -1212,6 +1212,17 @@ bool CPPSourceEmitter::tryEmitInstExprImpl(IRInst* inst, const EmitOpInfo& inOut m_writer->emit(")"); return true; } + case kIROp_GetTargetTupleElement: + { + auto outerPrec = getInfo(EmitOp::General); + auto prec = getInfo(EmitOp::Postfix); + m_writer->emit("std::get<"); + emitOperand(inst->getOperand(1), getInfo(EmitOp::General)); + m_writer->emit(">("); + emitOperand(inst->getOperand(0), leftSide(outerPrec, prec)); + m_writer->emit(")"); + return true; + } case kIROp_CastFloatToInt: case kIROp_CastIntToFloat: case kIROp_FloatCast: |
