Skip to content

Commit

Permalink
Rename FunctionCallConcreteLibfunc to SignatureAndFunctionConcreteLib…
Browse files Browse the repository at this point in the history
…func.

commit-id:53baa46f
  • Loading branch information
liorgold2 committed Dec 20, 2023
1 parent eb47e97 commit 57723a1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions crates/cairo-lang-sierra-gas/src/core_libfunc_cost_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -124,7 +124,7 @@ pub fn core_libfunc_cost(
info_provider: &dyn CostInfoProvider,
) -> Vec<BranchCost> {
match libfunc {
FunctionCall(FunctionCallConcreteLibfunc { function, .. }) => {
FunctionCall(SignatureAndFunctionConcreteLibfunc { function, .. }) => {
vec![BranchCost::FunctionCall {
const_cost: ConstCost::steps(2),
function: function.clone(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand All @@ -14,7 +14,7 @@ use crate::relocations::{Relocation, RelocationEntry};

/// Handles a function call.
pub fn build(
libfunc: &FunctionCallConcreteLibfunc,
libfunc: &SignatureAndFunctionConcreteLibfunc,
builder: CompiledInvocationBuilder<'_>,
) -> Result<CompiledInvocation, InvocationError> {
check_references_on_stack(builder.refs)?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
}
Expand All @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions crates/cairo-lang-sierra/src/simulation/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -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(_)) => {
Expand Down

0 comments on commit 57723a1

Please sign in to comment.