Skip to content

Commit a27a2e2

Browse files
committed
Drop LLVMTypeAnalyzer
1 parent 5d6216d commit a27a2e2

File tree

13 files changed

+16
-12932
lines changed

13 files changed

+16
-12932
lines changed

src/engine/internal/llvm/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ target_sources(scratchcpp
1919
llvmtypes.h
2020
llvmfunctions.cpp
2121
llvmfunctions.h
22-
llvmtypeanalyzer.cpp
23-
llvmtypeanalyzer.h
2422
llvmcompilercontext.cpp
2523
llvmcompilercontext.h
2624
llvmexecutablecode.cpp

src/engine/internal/llvm/instructions/lists.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ LLVMInstruction *Lists::buildAppendToList(LLVMInstruction *ins)
111111

112112
Compiler::StaticType listType = Compiler::StaticType::Unknown;
113113

114-
if (m_utils.warp())
115-
listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);
114+
/*if (m_utils.warp())
115+
listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);*/
116116

117117
// Check if enough space is allocated
118118
llvm::Value *allocatedSize = m_builder.CreateLoad(m_builder.getInt64Ty(), listPtr.allocatedSizePtr);
@@ -153,8 +153,8 @@ LLVMInstruction *Lists::buildInsertToList(LLVMInstruction *ins)
153153

154154
Compiler::StaticType listType = Compiler::StaticType::Unknown;
155155

156-
if (m_utils.warp())
157-
listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);
156+
/*if (m_utils.warp())
157+
listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);*/
158158

159159
// Range check
160160
llvm::Value *size = m_builder.CreateLoad(m_builder.getInt64Ty(), listPtr.sizePtr);
@@ -191,8 +191,8 @@ LLVMInstruction *Lists::buildListReplace(LLVMInstruction *ins)
191191

192192
Compiler::StaticType listType = Compiler::StaticType::Unknown;
193193

194-
if (m_utils.warp())
195-
listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);
194+
/*if (m_utils.warp())
195+
listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);*/
196196

197197
// Range check
198198
llvm::Value *min = llvm::ConstantFP::get(llvmCtx, llvm::APFloat(0.0));
@@ -234,8 +234,8 @@ LLVMInstruction *Lists::buildGetListItem(LLVMInstruction *ins)
234234

235235
Compiler::StaticType listType = Compiler::StaticType::Unknown;
236236

237-
if (m_utils.warp())
238-
listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);
237+
/*if (m_utils.warp())
238+
listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);*/
239239

240240
llvm::Value *min = llvm::ConstantFP::get(m_utils.llvmCtx(), llvm::APFloat(0.0));
241241
llvm::Value *size = m_builder.CreateLoad(m_builder.getInt64Ty(), listPtr.sizePtr);
@@ -271,8 +271,8 @@ LLVMInstruction *Lists::buildGetListItemIndex(LLVMInstruction *ins)
271271

272272
Compiler::StaticType listType = Compiler::StaticType::Unknown;
273273

274-
if (m_utils.warp())
275-
listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);
274+
/*if (m_utils.warp())
275+
listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);*/
276276

277277
ins->functionReturnReg->value = m_builder.CreateSIToFP(m_utils.getListItemIndex(listPtr, listType, arg.second), m_builder.getDoubleTy());
278278
return ins->next;
@@ -286,8 +286,8 @@ LLVMInstruction *Lists::buildListContainsItem(LLVMInstruction *ins)
286286

287287
Compiler::StaticType listType = Compiler::StaticType::Unknown;
288288

289-
if (m_utils.warp())
290-
listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);
289+
/*if (m_utils.warp())
290+
listType = m_utils.typeAnalyzer().listType(ins->workList, ins, Compiler::StaticType::Unknown, false);*/
291291

292292
llvm::Value *index = m_utils.getListItemIndex(listPtr, listType, arg.second);
293293
ins->functionReturnReg->value = m_builder.CreateICmpSGT(index, llvm::ConstantInt::get(m_builder.getInt64Ty(), -1, true));

src/engine/internal/llvm/instructions/variables.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ LLVMInstruction *Variables::buildWriteVariable(LLVMInstruction *ins)
115115

116116
Compiler::StaticType varType = Compiler::StaticType::Unknown;
117117

118-
if (m_utils.warp())
119-
varType = m_utils.typeAnalyzer().variableType(ins->workVariable, ins, Compiler::StaticType::Unknown);
118+
/*if (m_utils.warp())
119+
varType = m_utils.typeAnalyzer().variableType(ins->workVariable, ins, Compiler::StaticType::Unknown);*/
120120

121121
// Initialize stack variable on first assignment
122122
// TODO: Use stack in the top level (outside loops and if statements)
@@ -149,8 +149,8 @@ LLVMInstruction *Variables::buildReadVariable(LLVMInstruction *ins)
149149
LLVMVariablePtr &varPtr = m_utils.variablePtr(ins->workVariable);
150150
Compiler::StaticType type = Compiler::StaticType::Unknown;
151151

152-
if (m_utils.warp())
153-
type = m_utils.typeAnalyzer().variableType(ins->workVariable, ins, Compiler::StaticType::Unknown);
152+
/*if (m_utils.warp())
153+
type = m_utils.typeAnalyzer().variableType(ins->workVariable, ins, Compiler::StaticType::Unknown);*/
154154

155155
ins->functionReturnReg->value = varPtr.onStack && !(ins->loopCondition && !m_utils.warp()) ? varPtr.stackPtr : varPtr.heapPtr;
156156
ins->functionReturnReg->setType(type);

src/engine/internal/llvm/llvmbuildutils.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,6 @@ LLVMFunctions &LLVMBuildUtils::functions()
172172
return m_functions;
173173
}
174174

175-
LLVMTypeAnalyzer &LLVMBuildUtils::typeAnalyzer()
176-
{
177-
return m_typeAnalyzer;
178-
}
179-
180175
std::string LLVMBuildUtils::scriptFunctionName(BlockPrototype *procedurePrototype)
181176
{
182177
std::string name;

src/engine/internal/llvm/llvmbuildutils.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "llvmfunctions.h"
88
#include "llvmvariableptr.h"
99
#include "llvmlistptr.h"
10-
#include "llvmtypeanalyzer.h"
1110
#include "llvmcoroutine.h"
1211
#include "llvmifstatement.h"
1312
#include "llvmloop.h"
@@ -39,7 +38,6 @@ class LLVMBuildUtils
3938
llvm::IRBuilder<> &builder();
4039
llvm::Function *function() const;
4140
LLVMFunctions &functions();
42-
LLVMTypeAnalyzer &typeAnalyzer();
4341

4442
std::string scriptFunctionName(BlockPrototype *procedurePrototype);
4543
llvm::FunctionType *scriptFunctionType(BlockPrototype *procedurePrototype);
@@ -115,7 +113,6 @@ class LLVMBuildUtils
115113
llvm::LLVMContext &m_llvmCtx;
116114
llvm::IRBuilder<> &m_builder;
117115
LLVMFunctions m_functions;
118-
LLVMTypeAnalyzer m_typeAnalyzer;
119116
Target *m_target = nullptr;
120117
llvm::Function *m_function = nullptr;
121118

0 commit comments

Comments
 (0)