Skip to content

Commit

Permalink
fixup: clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbaden committed Dec 2, 2019
1 parent ebf6f7d commit 6413855
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
7 changes: 4 additions & 3 deletions QueryEngine/HashJoinRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,13 @@ DEVICE void store_payload(int32_t* hash_entry,
int64_t val =
fixed_width_int_decode_noinline(payload[p].col_buff, payload[p].elem_sz, pos);
int32_t* pos = hash_entry + payload[p].payload_offs;
if (payload[p].payload_size == 1)
if (payload[p].payload_size == 1) {
*pos = (int32_t)val;
else if (payload[p].payload_size == 2)
} else if (payload[p].payload_size == 2) {
*(int64_t*)pos = val;
else
} else {
CHECK(false);
}
}
}
#endif
Expand Down
6 changes: 4 additions & 2 deletions QueryEngine/IRCodegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,9 @@ std::vector<JoinLoop> Executor::buildJoinLoops(
auto* desc = get_column_descriptor_maybe(*col, cat);
if (desc && !desc->isSystemCol && !desc->isVirtualCol && !desc->isDeletedCol &&
!desc->columnType.get_physical_cols() && !desc->columnType.is_varlen() &&
(desc->columnType.get_size() <= 8))
(desc->columnType.get_size() <= 8)) {
payload_cols[col->getScanDesc().getNestLevel()].push_back(col);
}
}
}
for (size_t level_idx = 0, current_hash_table_idx = 0;
Expand Down Expand Up @@ -493,8 +494,9 @@ void Executor::addPayloadColumnIterators(const JoinHashTableInterface& hash_tabl

void Executor::codegenPayloadColumnIterators(const std::vector<llvm::Value*>& prev_iters,
const JoinHashTableInterface& hash_table) {
if (hash_table.getPayloadType() == JoinHashTableInterface::PayloadType::RowId)
if (hash_table.getPayloadType() == JoinHashTableInterface::PayloadType::RowId) {
return;
}

CHECK(!prev_iters.empty());
auto payload_ptr = prev_iters.back();
Expand Down
6 changes: 4 additions & 2 deletions QueryEngine/JoinHashTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,9 @@ std::shared_ptr<JoinHashTable> JoinHashTable::getInstance(
}
}
} catch (const OutOfMemory&) {
if (payload_cols.empty())
if (payload_cols.empty()) {
throw;
}

payload_cols.clear();
join_hash_table =
Expand Down Expand Up @@ -692,8 +693,9 @@ void JoinHashTable::tryReify(const int device_count, bool throw_out_of_memory) {
throw HashJoinFail(std::string("Could not build hash tables for equijoin | ") +
e.what());
} catch (const OutOfMemory& e) {
if (throw_out_of_memory)
if (throw_out_of_memory) {
throw;
}
throw HashJoinFail(
std::string("Ran out of memory while building hash tables for equijoin | ") +
e.what());
Expand Down
6 changes: 4 additions & 2 deletions QueryEngine/LoopControlFlow/JoinLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ llvm::BasicBlock* JoinLoop::codegen(
iteration_val = builder.CreateGEP(iteration_domain.values_buffer, offs);
}
iterators.push_back(iteration_val);
if (join_loop.payload_iterators_codegen_)
if (join_loop.payload_iterators_codegen_) {
join_loop.payload_iterators_codegen_(iterators);
}
const auto have_more_inner_rows = builder.CreateICmpSLT(
iteration_counter,
join_loop.kind_ == JoinLoopKind::UpperBound ? iteration_domain.upper_bound
Expand Down Expand Up @@ -168,8 +169,9 @@ llvm::BasicBlock* JoinLoop::codegen(
const auto iteration_domain = join_loop.iteration_domain_codegen_(iterators);
CHECK(!iteration_domain.values_buffer);
iterators.push_back(iteration_domain.slot_lookup_result);
if (join_loop.payload_iterators_codegen_)
if (join_loop.payload_iterators_codegen_) {
join_loop.payload_iterators_codegen_(iterators);
}
auto match_found = builder.CreateICmpSGE(iteration_domain.slot_lookup_result,
ll_int<int64_t>(0, context));
if (join_loop.is_deleted_) {
Expand Down

0 comments on commit 6413855

Please sign in to comment.