Skip to content

Commit 0844b1c

Browse files
committed
LLVMCodeBuilder: Store variable instructions
1 parent 5289781 commit 0844b1c

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
@@ -1269,6 +1269,7 @@ CompilerValue *LLVMCodeBuilder::addVariableValue(Variable *variable)
12691269
ins->functionReturnReg = ret.get();
12701270

12711271
m_instructions.push_back(ins);
1272+
m_variableInstructions.push_back(m_instructions.back());
12721273
return addReg(ret, ins);
12731274
}
12741275

@@ -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)