From 07c2f96ae65f962150610cd9dad35da0ed88ce04 Mon Sep 17 00:00:00 2001 From: Nagi5Yeq Date: Sun, 7 Jun 2020 19:03:35 +0800 Subject: fix syntax --- README.md | 2 +- node/StatementNode.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 75827a9..7c7e7ca 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Then you need to link the object file qsort.o by your host-compiler. See ssl.pas and extern.pas. -For the `scanf` case, the `scanf` may be a marco in C like `__isoc99_scanf`, so you may need to wrap the scanf function, see common.pas. +For the `scanf` case, the `scanf` may be a marco in C like `__isoc99_scanf`, so you may need to wrap the scanf function, see common.c. #### calling pascal functions from C diff --git a/node/StatementNode.cc b/node/StatementNode.cc index adce4f0..183bd0f 100644 --- a/node/StatementNode.cc +++ b/node/StatementNode.cc @@ -324,7 +324,7 @@ Value SwitchStatementNode::CodeGen() { : llvm::BasicBlock::Create(GlobalLLVMContext, "default")); llvm::SwitchInst* inst = builder->CreateSwitch(SwitchValue, DefaultBlock, CasePairs_.size() + 1); - std::shared_ptr PrevAcion = nullptr; + std::shared_ptr PrevAction = nullptr; llvm::BasicBlock* PrevBlock = nullptr; for (auto&& CaseChild : CasePairs_) { llvm::Value* CaseValue = std::get<0>(CaseChild)->CodeGen(); @@ -342,7 +342,7 @@ Value SwitchStatementNode::CodeGen() { CaseValue = builder->CreateSExtOrTrunc(CaseValue, type->GetLLVMType()); llvm::ConstantInt* CaseConst = llvm::cast(CaseValue); std::shared_ptr CaseAction = std::get<1>(CaseChild); - if (CaseAction == PrevAcion) { + if (CaseAction == PrevAction) { inst->addCase(CaseConst, PrevBlock); } else { llvm::BasicBlock* CaseBlock = @@ -351,7 +351,7 @@ Value SwitchStatementNode::CodeGen() { builder->SetInsertPoint(CaseBlock); CaseAction->CodeGen(); builder->CreateBr(EndBlock); - PrevAcion = CaseAction, PrevBlock = CaseBlock; + PrevAction = CaseAction, PrevBlock = CaseBlock; } } if (DefaultAction_ != nullptr) { -- cgit