aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorJosh Wolfe <thejoshwolfe@gmail.com>2017-09-01 10:27:04 -0700
committerJosh Wolfe <thejoshwolfe@gmail.com>2017-09-01 10:27:04 -0700
commit1449e71de87891757b35302a73f9f1ad03429030 (patch)
treefb0703fcab71c3f7becde32f8060fedb238588d7 /src/ir.cpp
parent848504117f17a5fa8ead8c168e0e430e22be6e43 (diff)
downloadzig-1449e71de87891757b35302a73f9f1ad03429030.tar.gz
zig-1449e71de87891757b35302a73f9f1ad03429030.zip
cleanup whitespace
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp28
1 files changed, 14 insertions, 14 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];