| 69 | } |
| 70 | |
| 71 | pub fn cached_function<A: Architecture>( |
| 72 | function: &BNFunction, |
| 73 | llil: &RegularLowLevelILFunction<A>, |
| 74 | ) -> Function { |
| 75 | let view = function.view(); |
| 76 | let view_id = ViewID::from(view.as_ref()); |
| 77 | let function_cache = FUNCTION_CACHE.get_or_init(Default::default); |
| 78 | match function_cache.get(&view_id) { |
| 79 | Some(cache) => cache.function(function, llil), |
| 80 | None => { |
| 81 | let cache = FunctionCache::default(); |
| 82 | let function = cache.function(function, llil); |
| 83 | function_cache.insert(view_id, cache); |
| 84 | function |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | pub fn cached_call_site_constraints(function: &BNFunction) -> HashSet<FunctionConstraint> { |
| 90 | let view = function.view(); |