summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-ir-inline.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-06-01 22:29:10 -0700
committerGitHub <noreply@github.com>2022-06-01 22:29:10 -0700
commitbc6bc56db51d06b92dc63ef9c9e0def6c9760c9e (patch)
tree55aae1b64e3c0befe4b424764f6f0064701a9ffe /source/slang/slang-ir-inline.cpp
parent4f14efc9752d9ebc8538a2e29ed154a00dc99682 (diff)
Clean up void returns. (#2260)
* Clean up `IRReturnVoid`. * Update gitignore. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-inline.cpp')
-rw-r--r--source/slang/slang-ir-inline.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/source/slang/slang-ir-inline.cpp b/source/slang/slang-ir-inline.cpp
index ed4b34875..77691d169 100644
--- a/source/slang/slang-ir-inline.cpp
+++ b/source/slang/slang-ir-inline.cpp
@@ -349,7 +349,7 @@ struct InliningPassBase
{
for (auto inst : block->getChildren())
{
- if (inst->getOp() == kIROp_ReturnVal || inst->getOp() == kIROp_ReturnVoid)
+ if (inst->getOp() == kIROp_Return)
{
// If the return is not at the end of the block, we cannot handle it.
if (inst != block->getTerminator())
@@ -494,18 +494,10 @@ struct InliningPassBase
_cloneInstWithSourceLoc(callSite, env, builder, inst);
break;
- case kIROp_ReturnVoid:
- // A return with no operand is replaced with a branch into `afterBlock`
+ case kIROp_Return:
+ // A return is replaced with a branch into `afterBlock`
// to return the control flow to the location after the original `call`.
- {
- auto returnBranch = builder->emitBranch(afterBlock);
- _setSourceLoc(returnBranch, inst, callSite);
- }
- break;
-
- case kIROp_ReturnVal:
- // A return with a value is similar to `returnVoid` except
- // that we need to note the (clone of the) value being
+ // We also need to note the (clone of the) value being
// returned, so that we can use it to replace the value
// of the original call.
//