From 1449e71de87891757b35302a73f9f1ad03429030 Mon Sep 17 00:00:00 2001 From: Josh Wolfe Date: Fri, 1 Sep 2017 10:27:04 -0700 Subject: [PATCH] cleanup whitespace --- src/ir.cpp | 28 ++++++++++++++-------------- src/zig_llvm.cpp | 2 +- src/zig_llvm.hpp | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/ir.cpp b/src/ir.cpp index 74a48f6f50..0d43398ba8 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -9386,21 +9386,21 @@ static TypeTableEntry *ir_analyze_bin_op_math(IrAnalyze *ira, IrInstructionBinOp if (is_signed_div) { bool ok = false; if (instr_is_comptime(op1) && instr_is_comptime(op2)) { - if (bigint_cmp_zero(&op2->value.data.x_bigint) == CmpEQ) { + if (bigint_cmp_zero(&op2->value.data.x_bigint) == CmpEQ) { // the division by zero error will be caught later, but we don't have a // division function ambiguity problem. op_id = IrBinOpDivTrunc; - ok = true; - } else { - BigInt trunc_result; - BigInt floor_result; - bigint_div_trunc(&trunc_result, &op1->value.data.x_bigint, &op2->value.data.x_bigint); - bigint_div_floor(&floor_result, &op1->value.data.x_bigint, &op2->value.data.x_bigint); - if (bigint_cmp(&trunc_result, &floor_result) == CmpEQ) { - ok = true; - op_id = IrBinOpDivTrunc; - } - } + ok = true; + } else { + BigInt trunc_result; + BigInt floor_result; + bigint_div_trunc(&trunc_result, &op1->value.data.x_bigint, &op2->value.data.x_bigint); + bigint_div_floor(&floor_result, &op1->value.data.x_bigint, &op2->value.data.x_bigint); + if (bigint_cmp(&trunc_result, &floor_result) == CmpEQ) { + ok = true; + op_id = IrBinOpDivTrunc; + } + } } if (!ok) { ir_add_error(ira, &bin_op_instruction->base, @@ -9697,7 +9697,7 @@ static TypeTableEntry *ir_analyze_array_mult(IrAnalyze *ira, IrInstructionBinOp uint64_t old_array_len = array_type->data.array.len; uint64_t new_array_len; - if (__builtin_umulll_overflow((unsigned long long)old_array_len, (unsigned long long)mult_amt, + if (__builtin_umulll_overflow((unsigned long long)old_array_len, (unsigned long long)mult_amt, (unsigned long long*)&new_array_len)) { ir_add_error(ira, &instruction->base, buf_sprintf("operation results in overflow")); @@ -14396,7 +14396,7 @@ static TypeTableEntry *ir_analyze_instruction_fn_proto(IrAnalyze *ira, IrInstruc } } IrInstruction *param_type_value = instruction->param_types[fn_type_id.next_param_index]->other; - if (type_is_invalid(param_type_value->value.type)) + if (type_is_invalid(param_type_value->value.type)) return ira->codegen->builtin_types.entry_invalid; FnTypeParamInfo *param_info = &fn_type_id.param_info[fn_type_id.next_param_index]; diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp index 922a7d0229..71c5f90ec8 100644 --- a/src/zig_llvm.cpp +++ b/src/zig_llvm.cpp @@ -279,7 +279,7 @@ ZigLLVMDIType *ZigLLVMCreateDebugUnionType(ZigLLVMDIBuilder *dibuilder, ZigLLVMD ZigLLVMDIType *ZigLLVMCreateDebugStructType(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIScope *scope, const char *name, ZigLLVMDIFile *file, unsigned line_number, uint64_t size_in_bits, - uint64_t align_in_bits, unsigned flags, ZigLLVMDIType *derived_from, + uint64_t align_in_bits, unsigned flags, ZigLLVMDIType *derived_from, ZigLLVMDIType **types_array, int types_array_len, unsigned run_time_lang, ZigLLVMDIType *vtable_holder, const char *unique_id) { diff --git a/src/zig_llvm.hpp b/src/zig_llvm.hpp index 376e7e919d..695deced5c 100644 --- a/src/zig_llvm.hpp +++ b/src/zig_llvm.hpp @@ -72,7 +72,7 @@ ZigLLVMDIType *ZigLLVMCreateDebugEnumerationType(ZigLLVMDIBuilder *dibuilder, Zi ZigLLVMDIType *ZigLLVMCreateDebugStructType(ZigLLVMDIBuilder *dibuilder, ZigLLVMDIScope *scope, const char *name, ZigLLVMDIFile *file, unsigned line_number, uint64_t size_in_bits, - uint64_t align_in_bits, unsigned flags, ZigLLVMDIType *derived_from, + uint64_t align_in_bits, unsigned flags, ZigLLVMDIType *derived_from, ZigLLVMDIType **types_array, int types_array_len, unsigned run_time_lang, ZigLLVMDIType *vtable_holder, const char *unique_id);