From 097282a1c47a981c96b184912d41e9d5a9efa844 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 1 Nov 2022 10:26:22 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- taichi/codegen/llvm/codegen_llvm.cpp | 13 ++++++++----- taichi/codegen/llvm/codegen_llvm.h | 6 ++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/taichi/codegen/llvm/codegen_llvm.cpp b/taichi/codegen/llvm/codegen_llvm.cpp index 50dba0b67d1a7..711f2d562ccb6 100644 --- a/taichi/codegen/llvm/codegen_llvm.cpp +++ b/taichi/codegen/llvm/codegen_llvm.cpp @@ -22,15 +22,16 @@ namespace taichi::lang { // TODO(k-ye): Hide FunctionCreationGuard inside cpp file FunctionCreationGuard::FunctionCreationGuard( TaskCodeGenLLVM *mb, - std::vector arguments, const std::string &func_name) + std::vector arguments, + const std::string &func_name) : mb(mb) { // Create the loop body function auto body_function_type = llvm::FunctionType::get( llvm::Type::getVoidTy(*mb->llvm_context), arguments, false); body = llvm::Function::Create(body_function_type, - llvm::Function::InternalLinkage, - func_name, mb->module.get()); + llvm::Function::InternalLinkage, func_name, + mb->module.get()); old_func = mb->func; // emit into loop body function mb->func = body; @@ -2668,7 +2669,8 @@ void TaskCodeGenLLVM::eliminate_unused_functions() { } FunctionCreationGuard TaskCodeGenLLVM::get_function_creation_guard( - std::vector argument_types, const std::string &func_name) { + std::vector argument_types, + const std::string &func_name) { return FunctionCreationGuard(this, argument_types, func_name); } @@ -2804,7 +2806,8 @@ void TaskCodeGenLLVM::visit(ReferenceStmt *stmt) { void TaskCodeGenLLVM::visit(FuncCallStmt *stmt) { if (!func_map.count(stmt->func)) { auto guard = get_function_creation_guard( - {llvm::PointerType::get(get_runtime_type("RuntimeContext"), 0)}, stmt->func->get_name()); + {llvm::PointerType::get(get_runtime_type("RuntimeContext"), 0)}, + stmt->func->get_name()); func_map.insert({stmt->func, guard.body}); stmt->func->ir->accept(this); } diff --git a/taichi/codegen/llvm/codegen_llvm.h b/taichi/codegen/llvm/codegen_llvm.h index 7965c3f64eb22..78db83f35c8ff 100644 --- a/taichi/codegen/llvm/codegen_llvm.h +++ b/taichi/codegen/llvm/codegen_llvm.h @@ -25,7 +25,8 @@ class FunctionCreationGuard { llvm::IRBuilder<>::InsertPoint ip; FunctionCreationGuard(TaskCodeGenLLVM *mb, - std::vector arguments, const std::string &func_name); + std::vector arguments, + const std::string &func_name); ~FunctionCreationGuard(); }; @@ -316,7 +317,8 @@ class TaskCodeGenLLVM : public IRVisitor, public LLVMModuleBuilder { void finalize_offloaded_task_function(); FunctionCreationGuard get_function_creation_guard( - std::vector argument_types, const std::string &func_name = "function_body"); + std::vector argument_types, + const std::string &func_name = "function_body"); std::tuple get_range_for_bounds( OffloadedStmt *stmt);