(
func: &BNFunction,
llil: &LowLevelILFunction<A, M, NonSSA<RegularNonSSA>>,
)
| 45 | } |
| 46 | |
| 47 | pub fn build_function<A: Architecture, M: FunctionMutability>( |
| 48 | func: &BNFunction, |
| 49 | llil: &LowLevelILFunction<A, M, NonSSA<RegularNonSSA>>, |
| 50 | ) -> Function { |
| 51 | let bn_fn_ty = func.function_type(); |
| 52 | Function { |
| 53 | guid: cached_function_guid(func, llil), |
| 54 | symbol: from_bn_symbol(&func.symbol()), |
| 55 | ty: from_bn_type(&func.view(), &bn_fn_ty, MAX_CONFIDENCE), |
| 56 | constraints: FunctionConstraints { |
| 57 | // NOTE: Adding adjacent only works if analysis is complete. |
| 58 | // NOTE: We do not filter out adjacent functions here. |
| 59 | adjacent: cached_adjacency_constraints(func, |_| true), |
| 60 | call_sites: cached_call_site_constraints(func), |
| 61 | // TODO: Add caller sites (when adjacent and call sites are minimal) |
| 62 | // NOTE: Adding caller sites only works if analysis is complete. |
| 63 | caller_sites: Default::default(), |
| 64 | }, |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | /// Basic blocks sorted from high to low. |
| 69 | pub fn sorted_basic_blocks(func: &BNFunction) -> Vec<BNRef<BNBasicBlock<NativeBlock>>> { |
no test coverage detected