@@ -153,7 +153,7 @@ std::shared_ptr<ExecutableCode> LLVMCodeBuilder::finalize()
153
153
pushScopeLevel ();
154
154
155
155
// Execute recorded steps
156
- for (const auto insPtr : m_instructionList ) {
156
+ for (LLVMInstruction *insPtr = m_instructions. first (); insPtr; insPtr = insPtr-> next ) {
157
157
const LLVMInstruction &step = *insPtr;
158
158
159
159
switch (step.type ) {
@@ -743,7 +743,7 @@ std::shared_ptr<ExecutableCode> LLVMCodeBuilder::finalize()
743
743
LLVMVariablePtr &varPtr = m_variablePtrs[step.workVariable ];
744
744
varPtr.changed = true ;
745
745
746
- const bool safe = isVarOrListTypeSafe (insPtr. get () , varPtr.type );
746
+ const bool safe = isVarOrListTypeSafe (insPtr, varPtr.type );
747
747
748
748
// Initialize stack variable on first assignment
749
749
if (!varPtr.onStack ) {
@@ -778,7 +778,7 @@ std::shared_ptr<ExecutableCode> LLVMCodeBuilder::finalize()
778
778
assert (step.args .size () == 0 );
779
779
LLVMVariablePtr &varPtr = m_variablePtrs[step.workVariable ];
780
780
781
- if (!isVarOrListTypeSafe (insPtr. get () , varPtr.type ))
781
+ if (!isVarOrListTypeSafe (insPtr, varPtr.type ))
782
782
varPtr.type = Compiler::StaticType::Unknown;
783
783
784
784
step.functionReturnReg ->value = varPtr.onStack && !(step.loopCondition && !m_warp) ? varPtr.stackPtr : varPtr.heapPtr ;
@@ -806,7 +806,7 @@ std::shared_ptr<ExecutableCode> LLVMCodeBuilder::finalize()
806
806
const auto &arg = step.args [0 ];
807
807
LLVMListPtr &listPtr = m_listPtrs[step.workList ];
808
808
809
- if (!isVarOrListTypeSafe (insPtr. get () , listPtr.type ))
809
+ if (!isVarOrListTypeSafe (insPtr, listPtr.type ))
810
810
listPtr.type = Compiler::StaticType::Unknown;
811
811
812
812
// Range check
@@ -846,7 +846,7 @@ std::shared_ptr<ExecutableCode> LLVMCodeBuilder::finalize()
846
846
typeMap[&listPtr] = listPtr.type ;
847
847
}
848
848
849
- if (!isVarOrListTypeSafe (insPtr. get () , listPtr.type ))
849
+ if (!isVarOrListTypeSafe (insPtr, listPtr.type ))
850
850
listPtr.type = Compiler::StaticType::Unknown;
851
851
852
852
// Check if enough space is allocated
@@ -894,7 +894,7 @@ std::shared_ptr<ExecutableCode> LLVMCodeBuilder::finalize()
894
894
typeMap[&listPtr] = listPtr.type ;
895
895
}
896
896
897
- if (!isVarOrListTypeSafe (insPtr. get () , listPtr.type ))
897
+ if (!isVarOrListTypeSafe (insPtr, listPtr.type ))
898
898
listPtr.type = Compiler::StaticType::Unknown;
899
899
900
900
llvm::Value *oldAllocatedSize = m_builder.CreateLoad (m_builder.getInt64Ty (), listPtr.allocatedSizePtr );
@@ -933,7 +933,7 @@ std::shared_ptr<ExecutableCode> LLVMCodeBuilder::finalize()
933
933
Compiler::StaticType type = optimizeRegisterType (valueArg.second );
934
934
LLVMListPtr &listPtr = m_listPtrs[step.workList ];
935
935
936
- if (!isVarOrListTypeSafe (insPtr. get () , listPtr.type ))
936
+ if (!isVarOrListTypeSafe (insPtr, listPtr.type ))
937
937
listPtr.type = Compiler::StaticType::Unknown;
938
938
939
939
// Range check
@@ -981,7 +981,7 @@ std::shared_ptr<ExecutableCode> LLVMCodeBuilder::finalize()
981
981
const auto &arg = step.args [0 ];
982
982
LLVMListPtr &listPtr = m_listPtrs[step.workList ];
983
983
984
- if (!isVarOrListTypeSafe (insPtr. get () , listPtr.type ))
984
+ if (!isVarOrListTypeSafe (insPtr, listPtr.type ))
985
985
listPtr.type = Compiler::StaticType::Unknown;
986
986
987
987
llvm::Value *min = llvm::ConstantFP::get (m_llvmCtx, llvm::APFloat (0.0 ));
@@ -1012,7 +1012,7 @@ std::shared_ptr<ExecutableCode> LLVMCodeBuilder::finalize()
1012
1012
const auto &arg = step.args [0 ];
1013
1013
LLVMListPtr &listPtr = m_listPtrs[step.workList ];
1014
1014
1015
- if (!isVarOrListTypeSafe (insPtr. get () , listPtr.type ))
1015
+ if (!isVarOrListTypeSafe (insPtr, listPtr.type ))
1016
1016
listPtr.type = Compiler::StaticType::Unknown;
1017
1017
1018
1018
step.functionReturnReg ->value = m_builder.CreateSIToFP (getListItemIndex (listPtr, arg.second ), m_builder.getDoubleTy ());
@@ -1024,7 +1024,7 @@ std::shared_ptr<ExecutableCode> LLVMCodeBuilder::finalize()
1024
1024
const auto &arg = step.args [0 ];
1025
1025
LLVMListPtr &listPtr = m_listPtrs[step.workList ];
1026
1026
1027
- if (!isVarOrListTypeSafe (insPtr. get () , listPtr.type ))
1027
+ if (!isVarOrListTypeSafe (insPtr, listPtr.type ))
1028
1028
listPtr.type = Compiler::StaticType::Unknown;
1029
1029
1030
1030
llvm::Value *index = getListItemIndex (listPtr, arg.second );
0 commit comments