From 57723a1e0626f31392b812139a6864dac2570e7b Mon Sep 17 00:00:00 2001 From: Lior Goldberg Date: Wed, 20 Dec 2023 13:55:49 +0200 Subject: [PATCH] Rename FunctionCallConcreteLibfunc to SignatureAndFunctionConcreteLibfunc. commit-id:53baa46f --- .../cairo-lang-sierra-gas/src/core_libfunc_cost_base.rs | 4 ++-- .../src/invocations/function_call.rs | 4 ++-- .../src/extensions/modules/function_call.rs | 8 ++++---- crates/cairo-lang-sierra/src/simulation/core.rs | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/crates/cairo-lang-sierra-gas/src/core_libfunc_cost_base.rs b/crates/cairo-lang-sierra-gas/src/core_libfunc_cost_base.rs index 599fd2b2e7a..c9573e2ba00 100644 --- a/crates/cairo-lang-sierra-gas/src/core_libfunc_cost_base.rs +++ b/crates/cairo-lang-sierra-gas/src/core_libfunc_cost_base.rs @@ -14,7 +14,7 @@ use cairo_lang_sierra::extensions::felt252::{ use cairo_lang_sierra::extensions::felt252_dict::{ Felt252DictConcreteLibfunc, Felt252DictEntryConcreteLibfunc, }; -use cairo_lang_sierra::extensions::function_call::FunctionCallConcreteLibfunc; +use cairo_lang_sierra::extensions::function_call::SignatureAndFunctionConcreteLibfunc; use cairo_lang_sierra::extensions::gas::CostTokenType; use cairo_lang_sierra::extensions::gas::GasConcreteLibfunc::{ BuiltinWithdrawGas, GetAvailableGas, GetBuiltinCosts, RedepositGas, WithdrawGas, @@ -124,7 +124,7 @@ pub fn core_libfunc_cost( info_provider: &dyn CostInfoProvider, ) -> Vec { match libfunc { - FunctionCall(FunctionCallConcreteLibfunc { function, .. }) => { + FunctionCall(SignatureAndFunctionConcreteLibfunc { function, .. }) => { vec![BranchCost::FunctionCall { const_cost: ConstCost::steps(2), function: function.clone(), diff --git a/crates/cairo-lang-sierra-to-casm/src/invocations/function_call.rs b/crates/cairo-lang-sierra-to-casm/src/invocations/function_call.rs index fc9ec264d42..e56381df96d 100644 --- a/crates/cairo-lang-sierra-to-casm/src/invocations/function_call.rs +++ b/crates/cairo-lang-sierra-to-casm/src/invocations/function_call.rs @@ -3,7 +3,7 @@ use std::collections::VecDeque; use cairo_lang_casm::casm; use cairo_lang_casm::cell_expression::CellExpression; use cairo_lang_casm::operand::{CellRef, Register}; -use cairo_lang_sierra::extensions::function_call::FunctionCallConcreteLibfunc; +use cairo_lang_sierra::extensions::function_call::SignatureAndFunctionConcreteLibfunc; use cairo_lang_sierra::extensions::ConcreteLibfunc; use super::{ @@ -14,7 +14,7 @@ use crate::relocations::{Relocation, RelocationEntry}; /// Handles a function call. pub fn build( - libfunc: &FunctionCallConcreteLibfunc, + libfunc: &SignatureAndFunctionConcreteLibfunc, builder: CompiledInvocationBuilder<'_>, ) -> Result { check_references_on_stack(builder.refs)?; diff --git a/crates/cairo-lang-sierra/src/extensions/modules/function_call.rs b/crates/cairo-lang-sierra/src/extensions/modules/function_call.rs index b4d8a20c693..b725198c8fc 100644 --- a/crates/cairo-lang-sierra/src/extensions/modules/function_call.rs +++ b/crates/cairo-lang-sierra/src/extensions/modules/function_call.rs @@ -42,7 +42,7 @@ fn get_output_var_infos( #[derive(Default)] pub struct FunctionCallLibfunc {} impl NamedLibfunc for FunctionCallLibfunc { - type Concrete = FunctionCallConcreteLibfunc; + type Concrete = SignatureAndFunctionConcreteLibfunc; const STR_ID: &'static str = "function_call"; fn specialize_signature( @@ -75,11 +75,11 @@ impl NamedLibfunc for FunctionCallLibfunc { } } -pub struct FunctionCallConcreteLibfunc { +pub struct SignatureAndFunctionConcreteLibfunc { pub function: Function, pub signature: LibfuncSignature, } -impl SignatureBasedConcreteLibfunc for FunctionCallConcreteLibfunc { +impl SignatureBasedConcreteLibfunc for SignatureAndFunctionConcreteLibfunc { fn signature(&self) -> &LibfuncSignature { &self.signature } @@ -89,7 +89,7 @@ impl SignatureBasedConcreteLibfunc for FunctionCallConcreteLibfunc { #[derive(Default)] pub struct CouponCallLibfunc {} impl NamedLibfunc for CouponCallLibfunc { - type Concrete = FunctionCallConcreteLibfunc; + type Concrete = SignatureAndFunctionConcreteLibfunc; const STR_ID: &'static str = "coupon_call"; fn specialize_signature( diff --git a/crates/cairo-lang-sierra/src/simulation/core.rs b/crates/cairo-lang-sierra/src/simulation/core.rs index 0d246de9418..8d6f8023a49 100644 --- a/crates/cairo-lang-sierra/src/simulation/core.rs +++ b/crates/cairo-lang-sierra/src/simulation/core.rs @@ -21,7 +21,7 @@ use crate::extensions::felt252::{ Felt252Concrete, Felt252ConstConcreteLibfunc, Felt252OperationWithConstConcreteLibfunc, }; use crate::extensions::felt252_dict::Felt252DictConcreteLibfunc; -use crate::extensions::function_call::FunctionCallConcreteLibfunc; +use crate::extensions::function_call::SignatureAndFunctionConcreteLibfunc; use crate::extensions::gas::GasConcreteLibfunc::{ BuiltinWithdrawGas, GetAvailableGas, GetBuiltinCosts, RedepositGas, WithdrawGas, }; @@ -90,8 +90,8 @@ pub fn simulate< }, _ => unimplemented!(), }, - FunctionCall(FunctionCallConcreteLibfunc { function, .. }) - | CouponCall(FunctionCallConcreteLibfunc { function, .. }) => { + FunctionCall(SignatureAndFunctionConcreteLibfunc { function, .. }) + | CouponCall(SignatureAndFunctionConcreteLibfunc { function, .. }) => { Ok((simulate_function(&function.id, inputs)?, 0)) } Gas(WithdrawGas(_)) => {