From 06f999b83442da757c7ba81df4f8e339d609fb2a Mon Sep 17 00:00:00 2001 From: Ryan Ziegler <rzig408@gmail.com> Date: Tue, 26 Nov 2024 10:49:50 -0500 Subject: [PATCH] minor fixes --- hercules_opt/src/utils.rs | 10 ++++++++++ juno_samples/complex_tuple.jn | 1 + 2 files changed, 11 insertions(+) diff --git a/hercules_opt/src/utils.rs b/hercules_opt/src/utils.rs index b26ee18c..3a8ffbef 100644 --- a/hercules_opt/src/utils.rs +++ b/hercules_opt/src/utils.rs @@ -4,6 +4,10 @@ use self::hercules_ir::ir::*; use crate::*; +/* + * Substitute all uses of a dynamic constant A with dynamic constant B in a + * type. Return the substituted version of the type, once memozied. + */ pub(crate) fn substitute_dynamic_constants_in_type( dc_a: DynamicConstantID, dc_b: DynamicConstantID, @@ -53,6 +57,12 @@ pub(crate) fn substitute_dynamic_constants_in_type( } } +/* + * Substitute all uses of a dynamic constant A with dynamic constant B in a + * dynamic constant C. Return the substituted version of C, once memoized. Takes + * a mutable edit instead of an editor since this may create new dynamic + * constants, which can only be done inside an edit. + */ pub(crate) fn substitute_dynamic_constants( dc_a: DynamicConstantID, dc_b: DynamicConstantID, diff --git a/juno_samples/complex_tuple.jn b/juno_samples/complex_tuple.jn index 46d44fd0..739944bb 100644 --- a/juno_samples/complex_tuple.jn +++ b/juno_samples/complex_tuple.jn @@ -4,6 +4,7 @@ fn test<x, y : usize>(a : i32[x, y]) -> (i32[x, y], i32[x,y]) { return (a, b); } +#[entry] fn main<x, y, z : usize>() -> i32[y, z] { let n : i32[y, z]; let res = test::<y, z>(n); -- GitLab