diff options
| author | _ov4 <hausemasterstream@gmail.com> | 2026-01-30 13:28:45 +0000 |
|---|---|---|
| committer | _ov4 <hausemasterstream@gmail.com> | 2026-01-30 13:28:45 +0000 |
| commit | 93175ba5edb0eacc182f573c4fd4556f089da305 (patch) | |
| tree | 0e50d5e0b50d7298dcb50342583fe4b718ccd1c0 /lib/CodeGen/ArrayHandler.cc | |
| parent | bd799e42b40613983c6e3cb9aedf58866ac68605 (diff) | |
Added BYREF and BYVAL
Diffstat (limited to 'lib/CodeGen/ArrayHandler.cc')
| -rw-r--r-- | lib/CodeGen/ArrayHandler.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/ArrayHandler.cc b/lib/CodeGen/ArrayHandler.cc index 18b9253..5842f77 100644 --- a/lib/CodeGen/ArrayHandler.cc +++ b/lib/CodeGen/ArrayHandler.cc @@ -8,7 +8,7 @@ using namespace llvm; using namespace cps; -ArrayHandler::ArrayHandler(LLVMContext &C, IRBuilder<> &B, Module &M, std::map<std::string, AllocaInst*> &NV, RuntimeCheck &RC) +ArrayHandler::ArrayHandler(LLVMContext &C, IRBuilder<> &B, Module &M, std::map<std::string, Value*> &NV, RuntimeCheck &RC) : TheContext(&C), Builder(&B), TheModule(&M), NamedValues(&NV), RuntimeChecker(RC) { setupExternalFunctions(); } @@ -125,7 +125,7 @@ Value* ArrayHandler::emitArrayAccess(ArrayAccessExprAST *Expr, CodeGen &CG) { Value *Offset = computeFlatIndex(Name, Indices); - AllocaInst *Alloca = (*NamedValues)[Name]; + Value *Alloca = (*NamedValues)[Name]; Value *RawPtr = Builder->CreateLoad(PointerType::getUnqual(*TheContext), Alloca); Value *IntPtr = Builder->CreateBitCast(RawPtr, PointerType::getUnqual(*TheContext)); Value *ElemPtr = Builder->CreateGEP(Type::getInt64Ty(*TheContext), IntPtr, Offset); @@ -154,7 +154,7 @@ void ArrayHandler::emitArrayAssign(ArrayAssignStmtAST *Stmt, CodeGen &CG) { Value *Val = CG.emitExpr(Stmt->getExpr()); Value *Offset = computeFlatIndex(Name, Indices); - AllocaInst *Alloca = (*NamedValues)[Name]; + Value *Alloca = (*NamedValues)[Name]; Value *RawPtr = Builder->CreateLoad(PointerType::getUnqual(*TheContext), Alloca); Value *IntPtr = Builder->CreateBitCast(RawPtr, PointerType::getUnqual(*TheContext)); Value *ElemPtr = Builder->CreateGEP(Type::getInt64Ty(*TheContext), IntPtr, Offset); @@ -197,7 +197,7 @@ void ArrayHandler::emitPrintLoop(const std::string &Name, int CurrentDim, std::v if (CurrentDim == Meta.Rank) { Value *Offset = computeFlatIndex(Name, CurrentIndices); - AllocaInst *Alloca = (*NamedValues)[Name]; + Value *Alloca = (*NamedValues)[Name]; Value *RawPtr = Builder->CreateLoad(PointerType::getUnqual(*TheContext), Alloca); Value *IntPtr = Builder->CreateBitCast(RawPtr, PointerType::getUnqual(*TheContext)); Value *ElemPtr = Builder->CreateGEP(Type::getInt64Ty(*TheContext), IntPtr, Offset); |
