From 2f2e058beb18afd6a648bd717c6cc946c5e2de58 Mon Sep 17 00:00:00 2001 From: Theodoros Kasampalis Date: Thu, 12 Dec 2024 14:48:26 -0600 Subject: [PATCH] use the apply parameter of make_function --- lib/codegen/CreateTerm.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/codegen/CreateTerm.cpp b/lib/codegen/CreateTerm.cpp index 1e03690cf..8141d9256 100644 --- a/lib/codegen/CreateTerm.cpp +++ b/lib/codegen/CreateTerm.cpp @@ -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(retval)) { @@ -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(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); }