Adds a new function instance to the cache
(&mut self, id: usize, mut fun: FunctionInstance)
| 51 | |
| 52 | /// Adds a new function instance to the cache |
| 53 | pub fn add_instance(&mut self, id: usize, mut fun: FunctionInstance) -> usize { |
| 54 | let functions = self.funs.get_mut(&id).expect("Function not found in cache"); |
| 55 | fun.variant_id = functions.instances.len(); |
| 56 | functions.instances.push(fun); |
| 57 | functions.instances.len() - 1 |
| 58 | } |
| 59 | |
| 60 | /// Gets all the function instances of a function declaration |
| 61 | pub fn get_instances_cloned(&self, id: usize) -> Option<Vec<FunctionInstance>> { |
no outgoing calls