summaryrefslogtreecommitdiff
path: root/source/slang/lower-to-ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/lower-to-ir.cpp')
-rw-r--r--source/slang/lower-to-ir.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/slang/lower-to-ir.cpp b/source/slang/lower-to-ir.cpp
index 6cce469ea..806654ccb 100644
--- a/source/slang/lower-to-ir.cpp
+++ b/source/slang/lower-to-ir.cpp
@@ -4012,18 +4012,19 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo>
// generating the code we actually care about, back in the original function.
auto builder = getBuilder();
+
auto initBlock = builder->createBlock();
auto afterBlock = builder->createBlock();
builder->emitIfElse(getSimpleVal(context, boolVal), afterBlock, initBlock, afterBlock);
- builder->setInsertInto(initBlock);
+ builder->insertBlock(initBlock);
LoweredValInfo initVal = lowerLValueExpr(context, initExpr);
assign(context, globalVal, initVal);
assign(context, boolVal, LoweredValInfo::simple(builder->getBoolValue(true)));
builder->emitBranch(afterBlock);
- builder->setInsertInto(afterBlock);
+ builder->insertBlock(afterBlock);
}
irGlobal->moveToEnd();