Skip to content

Commit

Permalink
use the apply parameter of make_function
Browse files Browse the repository at this point in the history
  • Loading branch information
theo25 committed Dec 12, 2024
1 parent 1d0356a commit 2f2e058
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/codegen/CreateTerm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1277,9 +1277,8 @@ bool make_function(
call->setTailCallKind(llvm::CallInst::TCK_MustTail);
retval = call;
} else {
bool is_apply_rule = name.substr(0, 11) == "apply_rule_";
size_t ordinal = 0;
if (is_apply_rule) {
if (apply) {
ordinal = std::stoll(name.substr(11));
}
if (auto *call = llvm::dyn_cast<llvm::CallInst>(retval)) {
Expand All @@ -1292,20 +1291,20 @@ bool make_function(
if (call->getCallingConv() == llvm::CallingConv::Tail
&& can_tail_call(call->getType())) {
call->setTailCallKind(llvm::CallInst::TCK_MustTail);
if (is_apply_rule) {
if (apply) {
current_block
= proof_event(definition, module)
.function_exit(
ordinal, true, llvm::dyn_cast<llvm::Instruction>(call));
}
} else {
if (is_apply_rule) {
if (apply) {
current_block = proof_event(definition, module)
.function_exit(ordinal, false, current_block);
}
}
} else {
if (is_apply_rule) {
if (apply) {
current_block = proof_event(definition, module)
.function_exit(ordinal, false, current_block);
}
Expand Down

0 comments on commit 2f2e058

Please sign in to comment.