diff options
| author | yum <yum.food.vr@gmail.com> | 2025-10-17 18:32:05 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-10-17 18:37:45 -0700 |
| commit | 668e7b4251e5fd1255fb7b265178c581061bfe10 (patch) | |
| tree | d6eda7388fc10279ab3af587d28545a93bf32028 /source | |
| parent | 482914e1b42dd44f4696b48c834136631672cebe (diff) | |
Improve unhandled instruction error message
It now includes the opcode in human-readable form.
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-emit-c-like.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp index 11ea2e989..ce8834925 100644 --- a/source/slang/slang-emit-c-like.cpp +++ b/source/slang/slang-emit-c-like.cpp @@ -2325,7 +2325,15 @@ void CLikeSourceEmitter::emitInstStmt(IRInst* inst) void CLikeSourceEmitter::diagnoseUnhandledInst(IRInst* inst) { - getSink()->diagnose(inst, Diagnostics::unimplemented, "unexpected IR opcode during code emit"); + std::string message = "unexpected IR opcode during code emit"; + + if (inst) { + const IRDumpOptions dumpOptions{IRDumpOptions::Mode::Detailed, + IRDumpOptions::Flag::DumpDebugIds}; + message += ": " + dumpIRToString(inst, dumpOptions); + } + + getSink()->diagnose(inst, Diagnostics::unimplemented, message); } bool CLikeSourceEmitter::hasExplicitConstantBufferOffset(IRInst* cbufferType) |
