diff options
| author | Yong He <yonghe@outlook.com> | 2020-07-10 09:13:50 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-10 09:13:50 -0700 |
| commit | 2503280122c7ac54cc3e42e2e54efff1d002d126 (patch) | |
| tree | f16d703731801fae2169aa500b6d4cfad2d6fae8 /source/slang/slang-emit-c-like.cpp | |
| parent | a5a67aae981cb54d535089b167d3edcc3a3a2e29 (diff) | |
Dynamic code gen for generic local variables. (#1434)
* Dynamic code gen for generic local variables.
* Fixes to function calls with generic typed `in` argument.
* Fixes per code review comments
Diffstat (limited to 'source/slang/slang-emit-c-like.cpp')
| -rw-r--r-- | source/slang/slang-emit-c-like.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp index 2f0b0b035..582f5e445 100644 --- a/source/slang/slang-emit-c-like.cpp +++ b/source/slang/slang-emit-c-like.cpp @@ -309,6 +309,14 @@ void CLikeSourceEmitter::emitInterface(IRInterfaceType* interfaceType) // This behavior is overloaded by concrete emitters. } +void CLikeSourceEmitter::emitRTTIObject(IRRTTIObject* rttiObject) +{ + SLANG_UNUSED(rttiObject); + // Ignore rtti object by default. + // This is only used in targets that support dynamic dispatching. +} + + void CLikeSourceEmitter::emitTypeImpl(IRType* type, const StringSliceLoc* nameAndLoc) { if (nameAndLoc) @@ -908,6 +916,7 @@ bool CLikeSourceEmitter::shouldFoldInstIntoUseSites(IRInst* inst) case kIROp_GlobalParam: case kIROp_Param: case kIROp_Func: + case kIROp_Alloca: return false; // Always fold these in, because they are trivial @@ -2010,6 +2019,8 @@ void CLikeSourceEmitter::defaultEmitInstExpr(IRInst* inst, const EmitOpInfo& inO /* Don't need to to output anything for this instruction - it's used for reflecting string literals that are hashed with 'getStringHash' */ break; + case kIROp_RTTIPointerType: + break; case kIROp_undefined: m_writer->emit(getName(inst)); @@ -3674,6 +3685,10 @@ void CLikeSourceEmitter::emitGlobalInst(IRInst* inst) emitWitnessTable(cast<IRWitnessTable>(inst)); break; + case kIROp_RTTIObject: + emitRTTIObject(cast<IRRTTIObject>(inst)); + break; + default: // We have an "ordinary" instruction at the global // scope, and we should therefore emit it using the |
