Skip to content

Commit

Permalink
clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
theo25 committed Dec 10, 2024
1 parent dfa9fe8 commit 572fe63
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 24 deletions.
9 changes: 3 additions & 6 deletions bindings/python/ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,14 +427,11 @@ void bind_proof_trace(py::module_ &m) {
&llvm_pattern_matching_failure_event::get_function_name);

py::class_<
llvm_tail_call_info_event,
std::shared_ptr<llvm_tail_call_info_event>>(
llvm_tail_call_info_event, std::shared_ptr<llvm_tail_call_info_event>>(
proof_trace, "llvm_tail_call_info_event", step_event)
.def_property_readonly(
"callern_name",
&llvm_tail_call_info_event::get_caller_name)
.def_property_readonly(
"is_tail", &llvm_tail_call_info_event::is_tail);
"callern_name", &llvm_tail_call_info_event::get_caller_name)
.def_property_readonly("is_tail", &llvm_tail_call_info_event::is_tail);

py::class_<llvm_function_event, std::shared_ptr<llvm_function_event>>(
proof_trace, "llvm_function_event", step_event)
Expand Down
3 changes: 1 addition & 2 deletions include/kllvm/binary/ProofTraceParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,7 @@ class proof_trace_parser {
case pattern_matching_failure_sentinel:
return parse_pattern_matching_failure(buffer);

case tail_call_info_sentinel:
return parse_tail_call_info(buffer);
case tail_call_info_sentinel: return parse_tail_call_info(buffer);

default: return nullptr;
}
Expand Down
4 changes: 2 additions & 2 deletions include/kllvm/codegen/ProofEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ class proof_event {
* Emit a call to the `tail_call_info` API of the specified `proof_writer`.
*/
llvm::CallInst *emit_write_tail_call_info(
llvm::Value *proof_writer, std::string const &caller_name,
bool is_tail, llvm::BasicBlock *insert_at_end);
llvm::Value *proof_writer, std::string const &caller_name, bool is_tail,
llvm::BasicBlock *insert_at_end);

/*
* Emit a call to the `start_new_chunk` API of the specified `proof_writer`.
Expand Down
16 changes: 7 additions & 9 deletions lib/codegen/CreateTerm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1286,18 +1286,16 @@ bool make_function(
if (call->getCallingConv() == llvm::CallingConv::Tail
&& can_tail_call(call->getType())) {
call->setTailCallKind(llvm::CallInst::TCK_MustTail);
current_block =
proof_event(definition, module)
.tail_call_info(name, true, call, current_block);
current_block = proof_event(definition, module)
.tail_call_info(name, true, call, current_block);
} else {
current_block =
proof_event(definition, module)
.tail_call_info(name, false, nullptr, current_block);
current_block
= proof_event(definition, module)
.tail_call_info(name, false, nullptr, current_block);
}
} else {
current_block =
proof_event(definition, module)
.tail_call_info(name, false, nullptr, current_block);
current_block = proof_event(definition, module)
.tail_call_info(name, false, nullptr, current_block);
}
}
auto *ret
Expand Down
9 changes: 4 additions & 5 deletions lib/codegen/ProofEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ llvm::CallInst *proof_event::emit_write_pattern_matching_failure(
}

llvm::CallInst *proof_event::emit_write_tail_call_info(
llvm::Value *proof_writer, std::string const &caller_name,
bool is_tail, llvm::BasicBlock *insert_at_end) {
llvm::Value *proof_writer, std::string const &caller_name, bool is_tail,
llvm::BasicBlock *insert_at_end) {
auto b = llvm::IRBuilder(insert_at_end);

auto *void_ty = llvm::Type::getVoidTy(ctx_);
Expand All @@ -319,8 +319,7 @@ llvm::CallInst *proof_event::emit_write_tail_call_info(
auto *func = get_or_insert_function(
module_, "write_tail_call_info_to_proof_trace", func_ty);

auto *var_caller_name
= b.CreateGlobalStringPtr(caller_name, "", 0, module_);
auto *var_caller_name = b.CreateGlobalStringPtr(caller_name, "", 0, module_);
auto *var_is_tail = llvm::ConstantInt::get(i8_ty, is_tail);
return b.CreateCall(func, {proof_writer, var_caller_name, var_is_tail});
}
Expand Down Expand Up @@ -753,7 +752,7 @@ llvm::BasicBlock *proof_event::tail_call_info(
return current_block;
}

std::tuple<llvm::BasicBlock *, llvm::BasicBlock *, llvm::Value *> prelude;
std::tuple<llvm::BasicBlock *, llvm::BasicBlock *, llvm::Value *> prelude;
if (is_tail) {
assert(insert_before);
prelude = event_prelude("tail_call_info", insert_before);
Expand Down

0 comments on commit 572fe63

Please sign in to comment.