summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-restructure.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir-restructure.cpp')
-rw-r--r--source/slang/slang-ir-restructure.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/source/slang/slang-ir-restructure.cpp b/source/slang/slang-ir-restructure.cpp
index 5dfb0179a..7ab5b4417 100644
--- a/source/slang/slang-ir-restructure.cpp
+++ b/source/slang/slang-ir-restructure.cpp
@@ -270,13 +270,12 @@ namespace Slang
// region representing an `if` statement.
//
auto ifInst = (IRIfElse*)terminator;
- auto condition = ifInst->getCondition();
auto trueBlock = ifInst->getTrueBlock();
auto falseBlock = ifInst->getFalseBlock();
auto afterBlock = ifInst->getAfterBlock();
- RefPtr<IfRegion> ifRegion = new IfRegion(parentRegion, condition);
+ RefPtr<IfRegion> ifRegion = new IfRegion(parentRegion, ifInst);
// The region for the "then" part of things will consist of
// the range of blocks `[trueBlock, afterBlock)`.
@@ -461,11 +460,10 @@ namespace Slang
// require something like the Relooper algorithm, though.
//
auto switchInst = (IRSwitch*) terminator;
- auto condition = switchInst->getCondition();
auto breakLabel = switchInst->getBreakLabel();
auto defaultLabel = switchInst->getDefaultLabel();
- RefPtr<SwitchRegion> switchRegion = new SwitchRegion(parentRegion, condition);
+ RefPtr<SwitchRegion> switchRegion = new SwitchRegion(parentRegion, switchInst);
// A direct branch to the block after the `switch` can
// be emitted as a `break` statement, so we will register