Skip to content

Commit 27e8a9f

Browse files
committed
LLVMCodeBuilder: Store variable instructions
1 parent 5289781 commit 27e8a9f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/engine/internal/llvm/llvmcodebuilder.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,7 @@ CompilerValue *LLVMCodeBuilder::addListItem(List *list, CompilerValue *index)
12981298
ins->functionReturnReg = ret.get();
12991299

13001300
m_instructions.push_back(ins);
1301+
m_variableInstructions.push_back(m_instructions.back());
13011302
return addReg(ret, ins);
13021303
}
13031304

@@ -1535,6 +1536,8 @@ void LLVMCodeBuilder::createVariableWrite(Variable *variable, CompilerValue *val
15351536

15361537
if (m_variablePtrs.find(variable) == m_variablePtrs.cend())
15371538
m_variablePtrs[variable] = LLVMVariablePtr();
1539+
1540+
m_variableInstructions.push_back(m_instructions.back());
15381541
}
15391542

15401543
void LLVMCodeBuilder::createListClear(List *list)

src/engine/internal/llvm/llvmcodebuilder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ class LLVMCodeBuilder : public ICodeBuilder
233233
std::vector<std::shared_ptr<LLVMLoopScope>> m_loopScopes;
234234
long m_loopScopeCounter = 0; // replacement for m_loopScopes size in build phase
235235
std::vector<long> m_loopScopeTree;
236+
std::vector<std::shared_ptr<LLVMInstruction>> m_variableInstructions;
236237
std::vector<std::vector<llvm::Value *>> m_heap; // scopes
237238

238239
std::shared_ptr<ExecutableCode> m_output;

0 commit comments

Comments
 (0)