diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-12-10 12:42:15 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-10 12:42:15 -0800 |
| commit | b2997170df7cc2703de714a946a38dc35058e7f8 (patch) | |
| tree | bbd19208ba07a2f45a2c25f28f6cf77be16f0b49 /source/slang/ir.cpp | |
| parent | 32f57c30cfce1681f5fe617e4fe230e88eb7b840 (diff) | |
Remove the "VM" and "bytecode" features (#745)
* Remove the "VM" and "bytecode" features
The "bytecode" in `bc.{h,cpp}` was an initial attempt at a serialized encoding for the Slang IR, but we now have the `ir-serialize.{h,cpp}` approach which was has been kept up to date much better.
Similarly, the "VM" in `vm.{h,cpp}` was intended to be a system for interpreting Slang code in the bytecode format directly (so that you could load and evaluate code in a Slang module in a lightweight fashion). This never got used past a single test, which we eventually disabled.
There are good ideas in some of this code, but at this point the implementations have bit-rotted to a point where trying to maintain it is more costly than it would be to re-created it if/when we ever decide these features are important again.
* fixup: remove slang-eval-test from Makefile
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) { |
