diff options
Diffstat (limited to 'source/slang/ir.cpp')
| -rw-r--r-- | source/slang/ir.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source/slang/ir.cpp b/source/slang/ir.cpp index 2f16f4ebc..c0715fca3 100644 --- a/source/slang/ir.cpp +++ b/source/slang/ir.cpp @@ -2617,7 +2617,20 @@ namespace Slang } } - bool opHasResult(IRInst* inst); + bool opHasResult(IRInst* inst) + { + auto type = inst->getDataType(); + if (!type) return false; + + // As a bit of a hack right now, we need to check whether + // the function returns the distinguished `Void` type, + // since that is conceptually the same as "not returning + // a value." + if(type->op == kIROp_VoidType) + return false; + + return true; + } bool instHasUses(IRInst* inst) { |
