@@ -119,7 +119,6 @@ LLVMInstruction *Control::buildBeginIf(LLVMInstruction *ins)
119119 m_builder.SetInsertPoint (statement.body );
120120
121121 m_utils.ifStatements ().push_back (statement);
122- m_utils.pushScopeLevel ();
123122
124123 return ins->next ;
125124}
@@ -135,7 +134,6 @@ LLVMInstruction *Control::buildBeginElse(LLVMInstruction *ins)
135134 // Jump to the branch after the if statement
136135 assert (!statement.afterIf );
137136 statement.afterIf = llvm::BasicBlock::Create (llvmCtx, " " , function);
138- m_utils.freeScopeHeap ();
139137 m_builder.CreateBr (statement.afterIf );
140138
141139 // Create else branch
@@ -157,7 +155,6 @@ LLVMInstruction *Control::buildEndIf(LLVMInstruction *ins)
157155 auto &ifStatements = m_utils.ifStatements ();
158156 assert (!ifStatements.empty ());
159157 LLVMIfStatement &statement = ifStatements.back ();
160- m_utils.freeScopeHeap ();
161158
162159 // Jump to the branch after the if statement
163160 if (!statement.afterIf )
@@ -176,7 +173,6 @@ LLVMInstruction *Control::buildEndIf(LLVMInstruction *ins)
176173 m_builder.SetInsertPoint (statement.afterIf );
177174
178175 ifStatements.pop_back ();
179- m_utils.popScopeLevel ();
180176
181177 return ins->next ;
182178}
@@ -236,7 +232,6 @@ LLVMInstruction *Control::buildBeginRepeatLoop(LLVMInstruction *ins)
236232 m_builder.SetInsertPoint (body);
237233
238234 m_utils.loops ().push_back (loop);
239- m_utils.pushScopeLevel ();
240235
241236 return ins->next ;
242237}
@@ -274,7 +269,6 @@ LLVMInstruction *Control::buildBeginWhileLoop(LLVMInstruction *ins)
274269
275270 // Switch to body branch
276271 m_builder.SetInsertPoint (body);
277- m_utils.pushScopeLevel ();
278272
279273 return ins->next ;
280274}
@@ -300,7 +294,6 @@ LLVMInstruction *Control::buildBeginRepeatUntilLoop(LLVMInstruction *ins)
300294
301295 // Switch to body branch
302296 m_builder.SetInsertPoint (body);
303- m_utils.pushScopeLevel ();
304297
305298 return ins->next ;
306299}
@@ -331,14 +324,12 @@ LLVMInstruction *Control::buildEndLoop(LLVMInstruction *ins)
331324 }
332325
333326 // Jump to the condition branch
334- m_utils.freeScopeHeap ();
335327 m_builder.CreateBr (loop.conditionBranch );
336328
337329 // Switch to the branch after the loop
338330 m_builder.SetInsertPoint (loop.afterLoop );
339331
340332 loops.pop_back ();
341- m_utils.popScopeLevel ();
342333
343334 return ins->next ;
344335}
@@ -351,7 +342,6 @@ LLVMInstruction *Control::buildStop(LLVMInstruction *ins)
351342
352343LLVMInstruction *Control::buildStopWithoutSync (LLVMInstruction *ins)
353344{
354- m_utils.freeScopeHeap ();
355345 m_builder.CreateBr (m_utils.endBranch ());
356346 llvm::BasicBlock *nextBranch = llvm::BasicBlock::Create (m_utils.llvmCtx (), " " , m_utils.function ());
357347 m_builder.SetInsertPoint (nextBranch);
0 commit comments